https://issues.dlang.org/show_bug.cgi?id=22563
--- Comment #2 from Stanislav Blinov <stanislav.bli...@gmail.com> --- It should in @safe code, which is where `scope` matters. The only way to escape it should be to break @safe. Isn't that the whole point?.. void* global; struct Escapist(T) { T value; } @safe void consumeThingWithContext(S)(scope S s) if (is(S == struct) && __traits(isNested, S)) { import core.lifetime; global = s.tupleof[$-1]; // error: scope variable `s` assigned to non-scope `global` global = move(s.tupleof[$-1]); // error: scope variable `s` assigned to non-scope `global` auto escape = new Escapist!S(s); // with dip1000: scope variable `s` may not be copied into allocated memory } @safe /*@nogc*/ void main() { int a; struct Nested { ~this() @nogc { a++; } } consumeThingWithContext(Nested()); } --