Bug 19838 – RefCounted fails to instantiate due to pureness of moveEmplace
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-04-30T12:03:43Z
Last change time
2019-07-10T11:11:43Z
Keywords
pull
Assigned to
No Owner
Creator
Márcio Martins
Comments
Comment #0 by marcioapm — 2019-04-30T12:03:43Z
I am getting this error when compiling with DMD 2.085.1.
It works fine with 2.083.1
Unfortunately I was not able to put together a simple test case.
/usr/include/dmd/phobos/std/typecons.d(6236,24): Error: pure function
std.typecons.RefCounted!(WrappedConnection!(LockedConnection!(Connection!VibeSocket*)), cast(RefCountedAutoInitialize)1).RefCounted.RefCountedStore.move cannot call impure function std.algorithm.mutation.moveEmplace!(WrappedConnection!(LockedConnection!(Connection!VibeSocket*))).moveEmplace
Looking at the code, it seems this commit broke it:
https://github.com/dlang/phobos/commit/c4324f405c6aea75c9c074c42a21b42a2a361d76#diff-4e008aedb3026d4a84f58323e53bf017
RefCountedStore.move() was made pure nothrow, but there is no guarantee that std.algorithm.moveEmplace will be so, as I suppose it's pureness is infered and therefore not always true.
Comment #1 by dlang-bot — 2019-05-15T09:50:04Z
@marcioapm created dlang/phobos pull request #7006 "Fix Issue 19838 - RefCounted fails to instantiate due to pureness of …" fixing this issue:
- Fix Issue 19838 - RefCounted fails to instantiate due to pureness of moveEmplace
https://github.com/dlang/phobos/pull/7006
Comment #2 by dlang-bot — 2019-07-10T11:11:43Z
dlang/phobos pull request #7006 "Fix Issue 19838 - RefCounted fails to instantiate due to pureness of …" was merged into stable:
- 2e408f13ea35b1b4242d7384782164f267a0dc96 by Márcio Martins:
Fix Issue 19838 - RefCounted fails to instantiate due to pureness of moveEmplace
https://github.com/dlang/phobos/pull/7006