auto merge of #10575 : sfackler/rust/non-copyable, r=huonw

The issue that required it has been fixed.
This commit is contained in:
bors 2013-11-19 20:31:21 -08:00
commit 6a25ba374b
2 changed files with 5 additions and 11 deletions

View 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 @@ impl RWLock {
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 @@ impl RWLock {
(&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 @@ impl RWLock {
}
}
}
RWLockReadMode { lock: token.lock, token: NonCopyable::new() }
RWLockReadMode { lock: token.lock, token: NonCopyable }
}
}
@ -682,7 +682,7 @@ impl<'self> RWLockWriteMode<'self> {
// 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 })
}
}

View 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) { }
}