On Borrow Checking

Walter Bright newshound2 at digitalmars.com
Sat May 10 15:41:37 UTC 2025


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; }
                                 ^
```


More information about the Digitalmars-d mailing list