Surely @safe code should be able to write/read data via File. Test case: import std.stdio; @safe void f() { writeln("Hello!"); } dmd output: Error: safe function 'f' cannot call system function 'writeln' This is on dmd 2.055 release.
writeln will call toString on arguments, which may not be trusted.
https://github.com/D-Programming-Language/phobos/pull/2230
https://github.com/D-Programming-Language/phobos/pull/2233
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/72aa8a9dca85fb03fdaaea74f1ca3303171caaeb Merge pull request #2233 from rbanderton/fix-writeln-inference Fix Issue 6644 - std.stdio write/writef(ln) are not @trusted