[Issue 14125] std.file has gotten out of hand

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 4 17:12:48 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14125

--- Comment #23 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to hsteoh from comment #20)
> It seems that there's a disconnect here between @trusted as marking a
> trusted *interface* (i.e., behind the interface is code that's potentially
> dangerous, but you cannot trigger the dangerous behaviour using that
> interface), and @trusted as marking a potentially dangerous *operation* that
> is actually safe because the surrounding context ensures that it is never
> used in an unsafe way.

If code marked as @safe is not mechanically checkable as being safe, it must
not be marked as safe. It should be marked as trusted. Trusted code is, by
definition, checked to be safe by the user. Safe code is, by definition,
checked by the compiler.

Hence "and @trusted as marking a potentially dangerous *operation* that
is actually safe because the surrounding context ensures that it is never
used in an unsafe way" is not correct. It would be correctly written as "and
@system as marking a potentially dangerous *operation* that is actually safe
because the surrounding @trusted context ensures that it is never used in an
unsafe way".

--


More information about the Digitalmars-d-bugs mailing list