diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-02-17 17:32:16 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-17 17:32:16 -0800 |
| commit | ba8ce4c2c27643cccfbbc481a19bcf4b7747cc89 (patch) | |
| tree | 158a22ef66d1d80f0e9e5d01dffb13496af236c2 /src/libstd/sync/mutex.rs | |
| parent | 6ac3799b75780f8c18bc38331403e1e517b89bab (diff) | |
| parent | 7a14f4994eb4527a38d02c61fa83822df02f7b5d (diff) | |
| download | rust-ba8ce4c2c27643cccfbbc481a19bcf4b7747cc89.tar.gz rust-ba8ce4c2c27643cccfbbc481a19bcf4b7747cc89.zip | |
rollup merge of #22319: huonw/send-is-not-static
Conflicts: src/libstd/sync/task_pool.rs src/libstd/thread.rs src/libtest/lib.rs src/test/bench/shootout-reverse-complement.rs src/test/bench/shootout-spectralnorm.rs
Diffstat (limited to 'src/libstd/sync/mutex.rs')
| -rw-r--r-- | src/libstd/sync/mutex.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index d7e8419f19f..65cae90857e 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -120,9 +120,9 @@ pub struct Mutex<T> { data: UnsafeCell<T>, } -unsafe impl<T:Send> Send for Mutex<T> { } +unsafe impl<T: Send + 'static> Send for Mutex<T> { } -unsafe impl<T:Send> Sync for Mutex<T> { } +unsafe impl<T: Send + 'static> Sync for Mutex<T> { } /// The static mutex type is provided to allow for static allocation of mutexes. /// @@ -180,7 +180,7 @@ pub const MUTEX_INIT: StaticMutex = StaticMutex { poison: poison::FLAG_INIT, }; -impl<T: Send> Mutex<T> { +impl<T: Send + 'static> Mutex<T> { /// Creates a new mutex in an unlocked state ready for use. #[stable(feature = "rust1", since = "1.0.0")] pub fn new(t: T) -> Mutex<T> { @@ -243,7 +243,7 @@ impl<T: Send> Mutex<T> { #[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] -impl<T: Send> Drop for Mutex<T> { +impl<T: Send + 'static> Drop for Mutex<T> { fn drop(&mut self) { // This is actually safe b/c we know that there is no further usage of // this mutex (it's up to the user to arrange for a mutex to get |
