On Borrow Checking
Manu
turkeyman at gmail.com
Sun May 11 04:07:34 UTC 2025
On Sun, 11 May 2025, 1:46 am Walter Bright via Digitalmars-d, <
digitalmars-d at puremagic.com> wrote:
> On 5/10/2025 5:10 AM, Manu wrote:
> > Okay, so then why should `scope` need `@safe`?
>
> It doesn't. It needs -dip1000, though.
>
> ```
> int* foo(scope int* q) { return q; }
> ```
> ```
> ./cc -c x.d -dip1000
> x.d(1): Error: scope parameter `q` may not be returned
> int* foo(scope int* q) { return q; }
> ^
> ```
>
I tested that and it didn't work for me. Maybe my test was faulty somehow
since I was working through numerous combinations, I'll try it again...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20250511/a3da5eac/attachment.htm>
More information about the Digitalmars-d
mailing list