diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-03-08 22:02:21 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-03-08 22:16:32 +1100 |
| commit | 0f6b43aa8f288d3d12adc8747fb5060956d7f0e5 (patch) | |
| tree | 1639424ddb7202a5b6acefa7f75825d6f768bd5c /src/libstd/sync/mpsc/mpsc_queue.rs | |
| parent | 25d070f228a101a806165a434b150a59a54f08ba (diff) | |
| download | rust-0f6b43aa8f288d3d12adc8747fb5060956d7f0e5.tar.gz rust-0f6b43aa8f288d3d12adc8747fb5060956d7f0e5.zip | |
Remove unneeded `Send` bounds from `std::sync::mpsc`.
The requirements `T: Send` only matter if the channel crosses thread boundaries i.e. the `Sender` or `Reciever` are sent across thread boundaries, and which is adequately controlled by the impls of `Send` for them. If `T` doesn't satisfy the bounds, then the types cannot cross thread boundaries and so everything is still safe (the pair of types collectively behave like a `Rc<RefCell<VecDeque>>`, or something of that nature).
Diffstat (limited to 'src/libstd/sync/mpsc/mpsc_queue.rs')
| -rw-r--r-- | src/libstd/sync/mpsc/mpsc_queue.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index 14ed253d8e2..8b6672e0c27 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -89,7 +89,7 @@ impl<T> Node<T> { } } -impl<T: Send> Queue<T> { +impl<T> Queue<T> { /// Creates a new queue that is safe to share among multiple producers and /// one consumer. pub fn new() -> Queue<T> { @@ -140,7 +140,7 @@ impl<T: Send> Queue<T> { #[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] -impl<T: Send> Drop for Queue<T> { +impl<T> Drop for Queue<T> { fn drop(&mut self) { unsafe { let mut cur = *self.tail.get(); |
