Simplification of @trusted

Ola Fosheim Grostad ola.fosheim.grostad at gmail.com
Thu Jun 17 06:31:48 UTC 2021


On Thursday, 17 June 2021 at 01:07:05 UTC, Paul Backus wrote:
> Of course, such a @trusted function should never pass code 
> review.

This isn't true. @trusted code may rely on invariants throughout 
the code base. As it should. And frequently does (or would if you 
tried to convert system code to safe). You can not make those 
invariants local to @trusted in the general case.

For instance algorithms that rely on sentinels. There is no 
reason to make all code that place sentinels @trusted.

There is a difference between preparing for danger and executing 
danger.




More information about the Digitalmars-d mailing list