Uh oh!
There was an error while loading. Please reload this page.
remove the T: Sync requirement for RwLock<T>: Send - #45267
Conversation
That requirement makes sense for containers like `Arc` that don't uniquely own their contents, but `RwLock` is not one of those. This restriction was added in rust-lang@380d23b, but it's not clear why.
rust-highfive
commented
Oct 13, 2017
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
cuviper
commented
Oct 16, 2017
|
alexcrichton
commented
Oct 19, 2017
Thanks for the PR! I think this change makes sense as well, especially along the lines of @cuviper's reasoning. I'm curious, though, what's the rationale for this change? Is code not compiling in the wild which should? |
oconnor663
commented
Oct 19, 2017
This only came up for me because I was trying to make a table of the |
alexcrichton
commented
Oct 19, 2017
Hm ok, thanks for the info. In that sense I'd like to be extra careful with this, so to get some more eyes I'll.... @rfcbot fcp merge |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
hniksic
commented
Oct 20, 2017
@alexcrichton Regarding which specific code doesn't compile and should, that would be any code that tries to send a I would still argue for the change to be accepted, for the following reasons:
|
For what it's worth, that commit also changed |
cuviper
commented
Oct 20, 2017
At the time, all of the methods were in |
aturon
commented
Oct 25, 2017
cc @RalfJung |
RalfJung
commented
Oct 25, 2017
Indeed, |
Actually there are some more unnecessary bounds, but they are implicit: |
oconnor663
commented
Oct 25, 2017
That is really cool :-D Should I add those removals to this PR, or better to make a separate one? |
alexcrichton
commented
Oct 31, 2017
bors
commented
Oct 31, 2017
📌 Commit fbf6885 has been approved by |
bors
commented
Nov 1, 2017
remove the `T: Sync` requirement for `RwLock<T>: Send` That requirement makes sense for containers like `Arc` that don't uniquely own their contents, but `RwLock` is not one of those. This restriction was added in 380d23b, but it's not clear why. @hniksic and I [were discussing this on reddit](https://www.reddit.com/r/rust/comments/763o7r/blog_posts_introducing_lockfree_rust_comparing/dobcvbm/). I might be totally wrong about this change being sound, but I'm super curious to find out :)
bors
commented
Nov 1, 2017
☀️ Test successful - status-appveyor, status-travis |
bstrie
commented
Nov 7, 2017
@oconnor663 Feel free to make another PR removing the remaining bounds if you're up to it. :) |
RalfJung
commented
Nov 8, 2017
I already did: #45682 |
That requirement makes sense for containers like
Arcthat don'tuniquely own their contents, but
RwLockis not one of those.This restriction was added in 380d23b, but it's not clear why. @hniksic
and I were discussing this on reddit. I might be totally wrong about this change being sound, but I'm super curious to find out :)