mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 12:44:40 +00:00
Remove NonCopyable::new
The issue that required it has been fixed.
This commit is contained in:
parent
c159acb05d
commit
3e637d505e
@ -326,7 +326,7 @@ impl Sem<~[WaitQueue]> {
|
|||||||
// and rwlock_write_mode.
|
// and rwlock_write_mode.
|
||||||
pub fn access_cond<U>(&self, blk: |c: &Condvar| -> U) -> U {
|
pub fn access_cond<U>(&self, blk: |c: &Condvar| -> U) -> U {
|
||||||
do self.access {
|
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 {
|
do task::rekillable {
|
||||||
let opt_lock = Just(&self.order_lock);
|
let opt_lock = Just(&self.order_lock);
|
||||||
blk(&Condvar { sem: cond.sem, order: opt_lock,
|
blk(&Condvar { sem: cond.sem, order: opt_lock,
|
||||||
token: NonCopyable::new() })
|
token: NonCopyable })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -605,7 +605,7 @@ impl RWLock {
|
|||||||
(&self.order_lock).release();
|
(&self.order_lock).release();
|
||||||
do (|| {
|
do (|| {
|
||||||
do task::rekillable {
|
do task::rekillable {
|
||||||
blk(RWLockWriteMode { lock: self, token: NonCopyable::new() })
|
blk(RWLockWriteMode { lock: self, token: NonCopyable })
|
||||||
}
|
}
|
||||||
}).finally {
|
}).finally {
|
||||||
let writer_or_last_reader;
|
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.
|
// access lock. See comment in RWLock::write_cond for why.
|
||||||
blk(&Condvar { sem: &self.lock.access_lock,
|
blk(&Condvar { sem: &self.lock.access_lock,
|
||||||
order: Just(&self.lock.order_lock),
|
order: Just(&self.lock.order_lock),
|
||||||
token: NonCopyable::new() })
|
token: NonCopyable })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,12 +62,6 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
|
|||||||
#[unsafe_no_drop_flag]
|
#[unsafe_no_drop_flag]
|
||||||
pub struct NonCopyable;
|
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 {
|
impl Drop for NonCopyable {
|
||||||
fn drop(&mut self) { }
|
fn drop(&mut self) { }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user