about summary refs log tree commit diff
path: root/src/libstd/sync/mpsc/mpsc_queue.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2015-02-13 22:58:37 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-02-18 08:19:21 +1100
commitd7b5bc3c2f673ac3edd818cb7bd42555c2cbc2a2 (patch)
tree9fc5d0740225f18a41e9dda8ef5bfbc132a858c2 /src/libstd/sync/mpsc/mpsc_queue.rs
parentcae969e2a755bd7e8ec22758a8a02146ddb599a4 (diff)
downloadrust-d7b5bc3c2f673ac3edd818cb7bd42555c2cbc2a2.tar.gz
rust-d7b5bc3c2f673ac3edd818cb7bd42555c2cbc2a2.zip
Update the libraries to reflect Send loosing the 'static bound.
In most places this preserves the current API by adding an explicit
`'static` bound.

Notably absent are some impls like `unsafe impl<T: Send> Send for
Foo<T>` and the `std::thread` module. It is likely that it will be
possible to remove these after auditing the code to ensure restricted
lifetimes are safe.

More progress on #22251.
Diffstat (limited to 'src/libstd/sync/mpsc/mpsc_queue.rs')
-rw-r--r--src/libstd/sync/mpsc/mpsc_queue.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs
index 3980d2a1fef..dceef683c2d 100644
--- a/src/libstd/sync/mpsc/mpsc_queue.rs
+++ b/src/libstd/sync/mpsc/mpsc_queue.rs
@@ -78,7 +78,7 @@ pub struct Queue<T> {
 }
 
 unsafe impl<T:Send> Send for Queue<T> { }
-unsafe impl<T:Send> Sync for Queue<T> { }
+unsafe impl<T: Send + 'static> Sync for Queue<T> { }
 
 impl<T> Node<T> {
     unsafe fn new(v: Option<T>) -> *mut Node<T> {
@@ -89,7 +89,7 @@ impl<T> Node<T> {
     }
 }
 
-impl<T: Send> Queue<T> {
+impl<T: Send + 'static> 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: Send + 'static> Drop for Queue<T> {
     fn drop(&mut self) {
         unsafe {
             let mut cur = *self.tail.get();