Skip to content

Commit

Permalink
Auto merge of #45267 - oconnor663:rwlock_send, r=alexcrichton
Browse files Browse the repository at this point in the history
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 :)
  • Loading branch information
bors committed Nov 1, 2017
2 parents fc3e12a + fbf6885 commit 31bbe57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub struct RwLock<T: ?Sized> {
}

#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<T: ?Sized + Send + Sync> Send for RwLock<T> {}
unsafe impl<T: ?Sized + Send> Send for RwLock<T> {}
#[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}

Expand Down

0 comments on commit 31bbe57

Please sign in to comment.