Simplification of @trusted

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Jun 17 18:33:06 UTC 2021


On Thursday, 17 June 2021 at 18:25:50 UTC, Dukc wrote:
> Well, if you make `module_0` or `module_a` unsound with your 
> changes to `module_0`, then there's no telling what `module_b` 
> will pass to your `@trusted` functions. But yes you can assume 
> those invariants as long as your API is sound when the 
> invariants hold.

Yes, let's assume I annotate my unsafe code with the invariants 
they depend on and do a new audit if any invariants in my modules 
change.

Those are my modules after all, so it isn't beyond reason for me 
to do this.

(Would be nice if it could be checked by machinery, of course, 
but manual audit is sufficient to discuss the core requirements 
of @trusted and @safe. :-)




More information about the Digitalmars-d mailing list