// 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 })
}
}
}
do task::rekillable {
let opt_lock = Just(&self.order_lock);
blk(&Condvar { sem: cond.sem, order: opt_lock,
- token: NonCopyable::new() })
+ token: NonCopyable })
}
}
}
(&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;
}
}
}
- RWLockReadMode { lock: token.lock, token: NonCopyable::new() }
+ RWLockReadMode { lock: token.lock, token: NonCopyable }
}
}
// 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 })
}
}
#[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) { }
}