about summary refs log tree commit diff
path: root/src/libstd/sync/mpsc/spsc_queue.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2015-02-20 17:33:11 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-02-21 16:51:49 +1100
commit380d23b5d4b9fb8f5f0ebf178590f61528b2483e (patch)
tree7e9378152fc5c721cba355b8007b2a7cd202fa69 /src/libstd/sync/mpsc/spsc_queue.rs
parent522d09dfecbeca1595f25ac58c6d0178bbd21d7d (diff)
downloadrust-380d23b5d4b9fb8f5f0ebf178590f61528b2483e.tar.gz
rust-380d23b5d4b9fb8f5f0ebf178590f61528b2483e.zip
Remove `'static` bound from sync::mpsc, Mutex and RwLock.
Adds some basic tests to check that the types still catch the most
glaring errors that could occur.

cc #22444.
Diffstat (limited to 'src/libstd/sync/mpsc/spsc_queue.rs')
-rw-r--r--src/libstd/sync/mpsc/spsc_queue.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs
index e1a89706509..f111e13975f 100644
--- a/src/libstd/sync/mpsc/spsc_queue.rs
+++ b/src/libstd/sync/mpsc/spsc_queue.rs
@@ -74,11 +74,11 @@ pub struct Queue<T> {
     cache_subtractions: AtomicUsize,
 }
 
-unsafe impl<T: Send + 'static> Send for Queue<T> { }
+unsafe impl<T: Send> Send for Queue<T> { }
 
-unsafe impl<T: Send + 'static> Sync for Queue<T> { }
+unsafe impl<T: Send> Sync for Queue<T> { }
 
-impl<T: Send + 'static> Node<T> {
+impl<T: Send> Node<T> {
     fn new() -> *mut Node<T> {
         unsafe {
             mem::transmute(box Node {
@@ -89,7 +89,7 @@ impl<T: Send + 'static> Node<T> {
     }
 }
 
-impl<T: Send + 'static> Queue<T> {
+impl<T: Send> Queue<T> {
     /// Creates a new queue.
     ///
     /// This is unsafe as the type system doesn't enforce a single
@@ -227,7 +227,7 @@ impl<T: Send + 'static> Queue<T> {
 }
 
 #[unsafe_destructor]
-impl<T: Send + 'static> Drop for Queue<T> {
+impl<T: Send> Drop for Queue<T> {
     fn drop(&mut self) {
         unsafe {
             let mut cur = *self.first.get();