[Issue 14137] std.socket.getAddressInfo breaks @safety
https://issues.dlang.org/show_bug.cgi?id=14137 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/c35d4aa26efd0907ccb48d7406dffc50f470971c Fix issue 14137: std.socket.getAddressInfo breaks @safe Remove abuse of @trusted in template function getAddressInfo that cannot guarantee that the incoming type argument is @safe. Localize @trusted block of the function to the single call to getAddressInfoImpl(), so that any @system code in T will be caught by the type system. Add unittest to ensure such examples of T will be rejected at compile-time. Mark normal unittest for getAddressInfo as @safe to ensure that the function body itself does not introduce any non-@safe code. https://github.com/dlang/phobos/commit/8a3453129f57a9db19c15026d184fc4e9da18ac3 Merge pull request #4009 from quickfur/issue14137 Fix issue 14137: std.socket.getAddressInfo breaks @safe --
[Issue 14137] std.socket.getAddressInfo breaks @safety
https://issues.dlang.org/show_bug.cgi?id=14137 hst...@quickfur.ath.cx changed: What|Removed |Added Keywords||pull --- Comment #4 from hst...@quickfur.ath.cx --- https://github.com/D-Programming-Language/phobos/pull/4009 --
[Issue 14137] std.socket.getAddressInfo breaks @safety
https://issues.dlang.org/show_bug.cgi?id=14137 --- Comment #3 from hst...@quickfur.ath.cx --- The sheer amount of @trusted functions in std.socket is utterly frightening. How sure are we that this code is adequately reviewed?? --
[Issue 14137] std.socket.getAddressInfo breaks @safety
https://issues.dlang.org/show_bug.cgi?id=14137 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment #2 from hst...@quickfur.ath.cx --- This is very bad. getAddressInfo() takes an ARBITRARY TYPE for its `options` parameter, yet it's marked @trusted ??! That's clearly ridiculous. What we need is a @safe unittest to ensure that it does not add any non-safety in the function body, but let the compiler determine whether the resulting combination with T is actually @safe. Unfortunately, even this is not enough, because getAddressInfoImpl is @system, so we need to wrap the call to it in a @trusted nested function. Ugh. --
[Issue 14137] std.socket.getAddressInfo breaks @safety
https://issues.dlang.org/show_bug.cgi?id=14137 David Nadlinger c...@klickverbot.at changed: What|Removed |Added Severity|enhancement |major --- Comment #1 from David Nadlinger c...@klickverbot.at --- Actually a permalink now: https://github.com/D-Programming-Language/phobos/blob/041db2d8fac2b1cf5169be7188ea537a01f27586/std/socket.d#L996-L997 --