2020-04-16 01:50:32 -05:00
|
|
|
// run-fail
|
2021-12-03 09:32:51 -06:00
|
|
|
// needs-unwind
|
2016-01-30 11:32:50 -06:00
|
|
|
// error-pattern:panic 1
|
|
|
|
// error-pattern:drop 2
|
|
|
|
|
|
|
|
struct Droppable(u32);
|
|
|
|
impl Drop for Droppable {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
if self.0 == 1 {
|
|
|
|
panic!("panic 1");
|
|
|
|
} else {
|
2018-11-02 13:11:31 -05:00
|
|
|
eprintln!("drop {}", self.0);
|
2016-01-30 11:32:50 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn mir() {
|
|
|
|
let x = Droppable(2);
|
|
|
|
let y = Droppable(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
mir();
|
|
|
|
}
|