On Borrow Checking

Manu turkeyman at gmail.com
Sat May 10 12:10:48 UTC 2025


On Fri, 2 May 2025 at 23:10, Dennis via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Friday, 2 May 2025 at 07:44:52 UTC, Manu wrote:
> > On a slight tangent; why do I need to attribute the function at
> > all for it check `scope` args don't escape?
>
> You don't need @live for that, only @safe and -preview=dip1000.
> @live / -preview=dip1021 checks for mutable aliasing, which is
> something added on top of `scope` escape analysis.
>

Okay, so then why should `scope` need `@safe`? It's an additional attribute
added in its own right; there's no apparent value to requiring a SECOND
attribute's presence in order to make the first attribute take effect.
`scope` should work when you write `scope`. If you don't want scope
checking, don't write `scope`...?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20250510/048c35f1/attachment.htm>


More information about the Digitalmars-d mailing list