parent
e1c1c059c6
commit
3ce75e786d
|
@ -437,7 +437,7 @@ fn test_option_dance() {
|
|||
}
|
||||
#[test] #[should_fail] #[ignore(cfg(windows))]
|
||||
fn test_option_too_much_dance() {
|
||||
let mut y = Some(util::NonCopyable());
|
||||
let mut y = Some(util::NonCopyable::new());
|
||||
let _y2 = y.swap_unwrap();
|
||||
let _y3 = y.swap_unwrap();
|
||||
}
|
||||
|
|
|
@ -79,13 +79,15 @@ pub struct NonCopyable {
|
|||
priv i: (),
|
||||
}
|
||||
|
||||
impl NonCopyable {
|
||||
/// Creates a dummy non-copyable structure and returns it for use.
|
||||
pub fn new() -> NonCopyable { NonCopyable { i: () } }
|
||||
}
|
||||
|
||||
impl Drop for NonCopyable {
|
||||
fn finalize(&self) { }
|
||||
}
|
||||
|
||||
/// Creates a dummy non-copyable structure and returns it for use.
|
||||
pub fn NonCopyable() -> NonCopyable { NonCopyable { i: () } }
|
||||
|
||||
|
||||
/// A type with no inhabitants
|
||||
pub enum Void { }
|
||||
|
|
Loading…
Reference in New Issue