about summary refs log tree commit diff
path: root/src/libstd/sync/mutex.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-22 10:27:08 +0000
committerbors <bors@rust-lang.org>2015-02-22 10:27:08 +0000
commitdcc6ce2c772cb851ac35cbc2ddafcae9bf2fa9fd (patch)
tree5c395b9b0e9b905648ed6de581ec601f4cc2ba9f /src/libstd/sync/mutex.rs
parenteb1b500a9a69b149295c37c2fe2c9409f406f9ea (diff)
parent380d23b5d4b9fb8f5f0ebf178590f61528b2483e (diff)
downloadrust-dcc6ce2c772cb851ac35cbc2ddafcae9bf2fa9fd.tar.gz
rust-dcc6ce2c772cb851ac35cbc2ddafcae9bf2fa9fd.zip
Auto merge of #22574 - huonw:remove-lame-statics, r=alexcirchton
Add a basic test that checks that the types catch the most glaring
errors that could occur.

cc #22444
Diffstat (limited to 'src/libstd/sync/mutex.rs')
-rw-r--r--src/libstd/sync/mutex.rs10
1 files changed, 5 insertions, 5 deletions
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<T> {
     data: UnsafeCell<T>,
 }
 
-unsafe impl<T: Send + 'static> Send for Mutex<T> { }
+unsafe impl<T: Send> Send for Mutex<T> { }
 
-unsafe impl<T: Send + 'static> Sync for Mutex<T> { }
+unsafe impl<T: Send> 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 + 'static> Mutex<T> {
+impl<T: Send> 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 + 'static> Mutex<T> {
 
 #[unsafe_destructor]
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Send + 'static> Drop for Mutex<T> {
+impl<T: Send> 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
@@ -354,7 +354,7 @@ mod test {
 
     struct Packet<T>(Arc<(Mutex<T>, Condvar)>);
 
-    unsafe impl<T:'static+Send> Send for Packet<T> {}
+    unsafe impl<T: Send> Send for Packet<T> {}
     unsafe impl<T> Sync for Packet<T> {}
 
     #[test]