@trusted attribute should be replaced with @trusted blocks

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Jan 16 15:29:58 UTC 2020


On Thursday, 16 January 2020 at 15:12:07 UTC, Paul Backus wrote:
> On Thursday, 16 January 2020 at 15:02:10 UTC, Ola Fosheim 
> Grøstad wrote:
>> If memory-safety is the default then you only need to mark 
>> functions and code blocks as unsafe. No need for @trusted or 
>> @safe.
>
> This is a non-sequitur. Did you mean to respond to a different 
> message?

It wasn't really clear what "IGotD-" meant. Although I suspect he 
was ironic, but if taken literally it would be fair to say that 
what D has is pretty much the same as this: assume all code is 
written as memory safe code and add an escape that allows for 
writing unsafe constructs adorned with a comment that says that 
code is trusted... except you also need to mark functions as 
unsafe. Not really a big shift from Rust, except Rust provides 
dedicated typing-constructs for doing unsafe operations like 
dealing with uninitialized variables.


More information about the Digitalmars-d mailing list