Bug 19738 – std.range.choose assignment breaks @safe-ty

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-03-15T04:54:01Z
Last change time
2020-01-10T05:44:41Z
Keywords
pull, safe
Assigned to
No Owner
Creator
David Nadlinger

Comments

Comment #0 by code — 2019-03-15T04:54:01Z
Introduced in https://github.com/dlang/phobos/pull/6904: --- import std.range; struct EvilRange { enum empty = true; int front; void popFront() @safe {} auto opAssign(const ref EvilRange other){ *(cast(uint*)0xcafebabe) = 0xdeadbeef; return this; } } void main() @safe { auto c1 = choose(true, EvilRange(), EvilRange()); auto c2 = c1; c1 = c2; } ---
Comment #1 by dlang-bot — 2019-03-24T00:15:31Z
@thewilsonator created dlang/phobos pull request #6933 "Fix Issue 19738 - std.range.choose assignment breaks @safe-ty" fixing this issue: - Fix Issue 19738 - std.range.choose assignment breaks @safe-ty https://github.com/dlang/phobos/pull/6933
Comment #2 by dlang-bot — 2020-01-10T02:57:06Z
@schveiguy created dlang/phobos pull request #7348 "Fix issue 19738 -- std.range.choose assignment breaks @safe-ty" fixing this issue: - Fix issue 19738. Make trusted parts of ChooseResult.opAssign smaller in case the individual ranges have system opAssign. https://github.com/dlang/phobos/pull/7348
Comment #3 by dlang-bot — 2020-01-10T05:44:41Z
dlang/phobos pull request #7348 "Fix issue 19738 -- std.range.choose assignment breaks @safe-ty" was merged into stable: - ae6de5515d17ba3f29e1533a8007e6099f157c50 by Steven Schveighoffer: Fix issue 19738. Make trusted parts of ChooseResult.opAssign smaller in case the individual ranges have system opAssign. https://github.com/dlang/phobos/pull/7348