remove incorrect use of 'scope'#4556
Conversation
e2051dd to
e2345e1
Compare
std/parallelism.d
Outdated
| // Hack to take the address of a nested function w/o | ||
| // making a closure. | ||
| static auto scopedAddress(D)(scope D del) | ||
| static auto scopedAddress(D)(D del) |
There was a problem hiding this comment.
As per the comment above, this is common pattern that various projects use (e.g. vibe.d) to ensure that the clojure is not allocated with the GC. AFAIK, there's no other way to achieve this, because you can't (and it's not practical to) require callers to be @nogc, because in general they're not under your control.
This particular case could be worked around, but it still a breaking change for user code.
There was a problem hiding this comment.
@WalterBright yah, can we add a cast to work around things?
There was a problem hiding this comment.
The final version will be return scope. But the compiler isn't ready for that yet, so I put in this workaround for now.
e2345e1 to
1decb74
Compare
|
This is a blocking issue for progress on |
|
Auto-merge toggled on |
|
Thanks! |
This is a blocker for dlang/dmd#5903