Borrowing and Ownership

ag0aep6g anonymous at
Sun Oct 27 23:10:22 UTC 2019

On 27.10.19 23:36, Timon Gehr wrote:
> - The problem with `@trusted` is that it has no defense against `@safe` 
> code destroying its invariants or accessing raw pointers that are only 
> meant to be manipulated by `@trusted` code. There should therefore be a 
> way to mark data as `@trusted` (or equivalent), such that `@safe` code 
> can not access it.

I know that the exact syntax isn't important (yet). Anyway:

@safe code can call @trusted functions. So it would be odd if @safe code 
weren't allowed to access @trusted data. I think `@system` would be a 
better fit for restricting access.

More information about the Digitalmars-d mailing list