Is @trusted the wrong direction?

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Sat Nov 9 06:55:02 UTC 2019


Trusted code is the gateway for safe code to call into system 
code. The code is suppose to indicate the layer for verify safe 
use of system code.

@safe
void main()
{
     foo();
}

@trusted
void foo () {
     auto fish = 5;
     auto m = &fish;
}

However the code itself is system code and the language does not 
restrict operations like in safe.

I'm wondering if trusted should operate in the same world as 
safe, with the benefit of calling @system code.

Now the concern would be that there would just be an additional 
system function between safe and the desired system code.

Would it make sense to analyze some existing trusted methods and 
suggest a change?


More information about the Digitalmars-d mailing list