Skip to content

Fix issue 13930, 19345 - Fix receiveOnly for non-assignable types #7655

Merged
dlang-bot merged 1 commit intodlang:masterfrom
tom-tan:fix-issue13930
Oct 10, 2020
Merged

Fix issue 13930, 19345 - Fix receiveOnly for non-assignable types #7655
dlang-bot merged 1 commit intodlang:masterfrom
tom-tan:fix-issue13930

Conversation

@tom-tan
Copy link
Contributor

@tom-tan tom-tan commented Oct 9, 2020

This request fixes the following two issues:

  • Fix issue 13930 - std.concurrency can't send immutable AA to another thread
  • Fix issue 19345 - std.concurrency does not work with structs of const value type

I used a different issue title for this request from the above two issues because the source of the problem is about receiveOnly rather than send function or std.concurrency itself.

@tom-tan tom-tan requested a review from MartinNowak as a code owner October 9, 2020 15:14
@dlang-bot
Copy link
Contributor

dlang-bot commented Oct 9, 2020

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 verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

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

Auto-close Bugzilla Severity Description
13930 normal std.concurrency can't send immutable AA to another thread
19345 normal std.concurrency does not work with structs of const value type

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#7655"

@thewilsonator
Copy link
Contributor

please rewrite the commit message to say fixes issues 13930, 19345 so the bot picks them up. (note the cross next to auto-close).

@tom-tan
Copy link
Contributor Author

tom-tan commented Oct 10, 2020

@thewilsonator Thank you for your advice. I updated the commit message.

@tom-tan tom-tan changed the title Fix receiveOnly for non-assignable types (issue 13930, issue 19345) Fix issue 13930, 19345 - Fix receiveOnly for non-assignable types Oct 10, 2020
@dlang-bot dlang-bot merged commit 4f4fef1 into dlang:master Oct 10, 2020
@tom-tan tom-tan deleted the fix-issue13930 branch October 10, 2020 02:13
@tom-tan
Copy link
Contributor Author

tom-tan commented Oct 10, 2020

Thanks!

@Geod24
Copy link
Member

Geod24 commented Oct 10, 2020

This fails on Win32:

"D:\a\1\dmd\generated\Windows\RelWithAsserts\Win32\dmd.exe" -conf= -g -m32mscoff -O -w -preview=dip1000 -transition=complex -I../druntime\import -unittest -version=StdUnittest -version=CoreUnittest -c  -ofunittest3c.obj std\signals.d  std\meta.d  std\typetuple.d  std\traits.d  std\encoding.d  std\xml.d  std\random.d  std\exception.d  std\compiler.d  std\system.d  std\concurrency.d
std\variant.d(703): Error: cannot modify struct instance `*p` of type `Aggregate` because it contains `const` or `immutable` members
std\variant.d(604): Error: template instance `std.variant.VariantN!20u.VariantN.opAssign!(const(Aggregate))` error instantiating
std\concurrency.d(126):        instantiated from here: `__ctor!(const(Aggregate))`
std\concurrency.d(660):        instantiated from here: `__ctor!(const(Aggregate))`
std\concurrency.d(650):        instantiated from here: `_send!(const(Aggregate))`
std\concurrency.d(627):        instantiated from here: `_send!(const(Aggregate))`
std\concurrency.d(2756):        instantiated from here: `send!(const(Aggregate))`

I have no idea why it doesn't fail on other platform, but this needs to be reverted. I'm also going to set Azure as required so that the bot doesn't merge failing PRs. Sorry @tom-tan , could you re-submit a PR after the revert ?

@tom-tan
Copy link
Contributor Author

tom-tan commented Oct 13, 2020

@Geod24 Done! See #7661.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments