@trusted attribute should be replaced with @trusted blocks

ag0aep6g anonymous at example.com
Thu Jan 16 21:11:26 UTC 2020


On Thursday, 16 January 2020 at 20:47:54 UTC, H. S. Teoh wrote:
> On Thu, Jan 16, 2020 at 02:18:09PM -0500, Steven Schveighoffer
[...]
>> The other option is to somehow use the compiler to enforce the 
>> semantic, like marking the *data* @system. In other words you 
>> are telling the compiler "I know that it's normally safe to 
>> change this tag, but in this case, you can't, because it will 
>> mess things up elsewhere".
> [...]
>
> So it's basically a way of tainting any code that touches the 
> data, such that you're not allowed to touch the data unless you 
> are @system or @trusted.
[...]
> By default, @safe comes with its own set of what constitutes 
> sensitive data, and operations on such data are rightfully 
> restricted.  Allowing the user to tag data as sensitive seems 
> to be a logical extension of @safe.

For reference, here's the upcoming DIP:

https://github.com/dlang/DIPs/pull/179


More information about the Digitalmars-d mailing list