1 // error-pattern:drop 1
2 // error-pattern:drop 2
3 // ignore-cloudabi no std::process
5 /// Structure which will not allow to be dropped twice.
6 struct Droppable<'a>(&'a mut bool, u32);
7 impl<'a> Drop for Droppable<'a> {
10 eprintln!("{} dropped twice", self.1);
11 ::std::process::exit(1);
13 eprintln!("drop {}", self.1);
19 let (mut xv, mut yv) = (false, false);
20 let x = Droppable(&mut xv, 1);
21 let y = Droppable(&mut yv, 2);