Compile with `-release`: ---- import std.range.primitives: popFront; import std.stdio: writeln; void main() @safe { char[3] a = "foo"; int x = 42; char[] b = a[0 .. 0]; b.popFront(); b[3] = 13; /* Writes over x. */ writeln(x); /* Prints "13". */ } ----
@aG0aep6G created dlang/phobos pull request #7535 "fix issue 20949 - std.range.popFront is unsafe in release mode" fixing this issue: - fix issue 20949 - std.range.popFront is unsafe in release mode https://github.com/dlang/phobos/pull/7535
dlang/phobos pull request #7535 "fix issue 20949 - std.range.popFront is unsafe in release mode" was merged into master: - 26822f44b5947137b19ba7094095f061334376a2 by aG0aep6G: fix issue 20949 - std.range.popFront is unsafe in release mode https://github.com/dlang/phobos/pull/7535