]> git.lizzy.rs Git - rust.git/commitdiff
Remove NonCopyable::new
authorSteven Fackler <sfackler@gmail.com>
Wed, 20 Nov 2013 04:19:05 +0000 (20:19 -0800)
committerSteven Fackler <sfackler@gmail.com>
Wed, 20 Nov 2013 04:27:48 +0000 (20:27 -0800)
The issue that required it has been fixed.

src/libextra/sync.rs
src/libstd/util.rs

index f01eb7ef2afe9267089cf6f034abe4e26f517ef5..a8fcbd521d026fb36be11122acbd520e284ce0ac 100644 (file)
@@ -326,7 +326,7 @@ impl Sem<~[WaitQueue]> {
     // and rwlock_write_mode.
     pub fn access_cond<U>(&self, blk: |c: &Condvar| -> U) -> U {
         do self.access {
-            blk(&Condvar { sem: self, order: Nothing, token: NonCopyable::new() })
+            blk(&Condvar { sem: self, order: Nothing, token: NonCopyable })
         }
     }
 }
@@ -569,7 +569,7 @@ pub fn write_cond<U>(&self, blk: |c: &Condvar| -> U) -> U {
                 do task::rekillable {
                     let opt_lock = Just(&self.order_lock);
                     blk(&Condvar { sem: cond.sem, order: opt_lock,
-                                   token: NonCopyable::new() })
+                                   token: NonCopyable })
                 }
             }
         }
@@ -605,7 +605,7 @@ pub fn write_downgrade<U>(&self, blk: |v: RWLockWriteMode| -> U) -> U {
             (&self.order_lock).release();
             do (|| {
                 do task::rekillable {
-                    blk(RWLockWriteMode { lock: self, token: NonCopyable::new() })
+                    blk(RWLockWriteMode { lock: self, token: NonCopyable })
                 }
             }).finally {
                 let writer_or_last_reader;
@@ -662,7 +662,7 @@ pub fn downgrade<'a>(&self, token: RWLockWriteMode<'a>)
                 }
             }
         }
-        RWLockReadMode { lock: token.lock, token: NonCopyable::new() }
+        RWLockReadMode { lock: token.lock, token: NonCopyable }
     }
 }
 
@@ -682,7 +682,7 @@ pub fn write_cond<U>(&self, blk: |c: &Condvar| -> U) -> U {
         // access lock. See comment in RWLock::write_cond for why.
         blk(&Condvar { sem:        &self.lock.access_lock,
                        order: Just(&self.lock.order_lock),
-                       token: NonCopyable::new() })
+                       token: NonCopyable })
     }
 }
 
index 3e44a30e47b33adcbf9d16c2cf1d51a00f0ec6fe..8e939caf756902a1a511f948e113463e9eeff5b9 100644 (file)
@@ -62,12 +62,6 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
 #[unsafe_no_drop_flag]
 pub struct NonCopyable;
 
-impl NonCopyable {
-    // FIXME(#8233) should not be necessary
-    /// Create a new noncopyable token.
-    pub fn new() -> NonCopyable { NonCopyable }
-}
-
 impl Drop for NonCopyable {
     fn drop(&mut self) { }
 }