diff --git a/dip1000.mak b/dip1000.mak index a7b7e2b4efd..38c8c612eb4 100644 --- a/dip1000.mak +++ b/dip1000.mak @@ -40,7 +40,7 @@ aa[std.path]=-dip25 # TODO aa[std.process]=-dip1000 aa[std.random]=-dip1000 aa[std.signals]=-dip1000 -aa[std.socket]=-dip25 # depends on https://github.com/dlang/phobos/pull/6204 merged, which will be at least deferred or possibly rejected (deprecation process required due to changed class Socket) +aa[std.socket]=-dip1000 aa[std.stdint]=-dip1000 aa[std.stdio]=-dip25 # TODO aa[std.string]=-dip1000 diff --git a/std/socket.d b/std/socket.d index 1e668f425bf..9fb77a997bf 100644 --- a/std/socket.d +++ b/std/socket.d @@ -2477,13 +2477,21 @@ public: assert(!errorSet.isSet(testPair[1])); ubyte[1] b; - testPair[0].send(b[]); + // Socket.send can't be marked with `scope` + // -> @safe DIP1000 code can't use it - see https://github.com/dlang/phobos/pull/6204 + () @trusted { + testPair[0].send(b[]); + }(); fillSets(); n = Socket.select(readSet, null, null); assert(n == 1); // testPair[1] assert(readSet.isSet(testPair[1])); assert(!readSet.isSet(testPair[0])); - testPair[1].receive(b[]); + // Socket.receive can't be marked with `scope` + // -> @safe DIP1000 code can't use it - see https://github.com/dlang/phobos/pull/6204 + () @trusted { + testPair[1].receive(b[]); + }(); } }); }