From 380d23b5d4b9fb8f5f0ebf178590f61528b2483e Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Fri, 20 Feb 2015 17:33:11 +1100 Subject: 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. --- src/libstd/sync/mutex.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libstd/sync/mutex.rs') diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index e77c4d2e5eb..b71cc0c2653 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -120,9 +120,9 @@ pub struct Mutex { data: UnsafeCell, } -unsafe impl Send for Mutex { } +unsafe impl Send for Mutex { } -unsafe impl Sync for Mutex { } +unsafe impl Sync for Mutex { } /// 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 Mutex { +impl Mutex { /// Creates a new mutex in an unlocked state ready for use. #[stable(feature = "rust1", since = "1.0.0")] pub fn new(t: T) -> Mutex { @@ -243,7 +243,7 @@ impl Mutex { #[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] -impl Drop for Mutex { +impl Drop for Mutex { 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 @@ -354,7 +354,7 @@ mod test { struct Packet(Arc<(Mutex, Condvar)>); - unsafe impl Send for Packet {} + unsafe impl Send for Packet {} unsafe impl Sync for Packet {} #[test] -- cgit 1.4.1-3-g733a5