On Borrow Checking

Timon Gehr timon.gehr at gmx.ch
Mon May 12 12:34:21 UTC 2025


On 5/12/25 13:52, Richard (Rikki) Andrew Cattermole wrote:
> 
> It has everything to do with @safe, that is where the mechanical checks 
> exist.
> 
> You do not need the escape set (``scope``), if you do not have the 
> mechanical checks, and where you have an escape hatch (``@trusted`` and 
> ``@system``), these are intentionally not turned on.

Even in `@system` code you cannot assign an `int` to an `int*`, you have 
to use an explicit cast. I don't think it is true that just because 
`@system` does not give you memory safety guarantees it will therefore 
be expected that features do not work at all.

This is a design decision, and I think Manu's and Walter's expectations 
are more reasonable than what the compiler actually does.


More information about the Digitalmars-d mailing list