@trusted assumptions about @safe code

ag0aep6g anonymous at example.com
Tue May 26 06:14:45 UTC 2020


On 26.05.20 02:57, Arine wrote:
> You are passing a pointer into a function that takes a mutable size_t by 
> reference and then use the pointer afterwards. You get what's coming to 
> you if you think that's suitable for @trusted.
> 
> This is a good example that care must still be taken in @trusted. You 
> are doing something dangerous, expect to be burned by it.

So would you say that the function should not have been @trusted in the 
first place, because it can't guarantee to stay safe?

Or was the @trusted attribute okay at first, and it only became invalid 
later when the @safe code changed? And is it acceptable that @safe code 
can invalidate @trusted attributes like that?


More information about the Digitalmars-d mailing list