Fix issue 13930, 19345 - Fix receiveOnly for non-assignable types#7661
Fix issue 13930, 19345 - Fix receiveOnly for non-assignable types#7661dlang-bot merged 2 commits intodlang:masterfrom
receiveOnly for non-assignable types#7661Conversation
|
Thanks for your pull request and interest in making D better, @tom-tan! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#7661" |
|
Looks all green this time, thanks! |
|
This might cause random segfaults: dlang/dmd#11868 (comment) From a quick glance, the |
|
This request uses
Do you have any ideas or thoughts? |
| else | ||
| { | ||
| import core.lifetime : emplace; | ||
| emplace(p, rhs); |
There was a problem hiding this comment.
AFAIK, this requires the type UT to feature a constructor taking a T rhs lvalue argument, and should thus be equivalent to auto p = new UT(rhs). - I think that's not suited in general and should probably be replaced by a manual copy-emplace as used for the T.sizeof <= size case above. It cheats around immutability by faking a copy-construct, performing a bitcopy and invoking the postblit if necessary. By the looks of it, it currently seems to ignore copy ctors...
|
This PR introduced a regression: |
This is a re-submit version of #7655.