]>
Commit | Line | Data |
---|---|---|
f9f354fc | 1 | // run-fail |
9cc50fc6 SL |
2 | // error-pattern:diverging_fn called |
3 | // error-pattern:0 dropped | |
f2b60f7d | 4 | // needs-unwind this test checks that a destructor is called after panicking |
7453a54e | 5 | |
9cc50fc6 SL |
6 | struct Droppable(u8); |
7 | impl Drop for Droppable { | |
8 | fn drop(&mut self) { | |
abe05a73 | 9 | eprintln!("{} dropped", self.0); |
9cc50fc6 SL |
10 | } |
11 | } | |
223e47cc | 12 | |
9cc50fc6 SL |
13 | fn diverging_fn() -> ! { |
14 | panic!("diverging_fn called") | |
15 | } | |
85aaf69f | 16 | |
9cc50fc6 SL |
17 | fn mir(d: Droppable) { |
18 | diverging_fn(); | |
85aaf69f | 19 | } |
223e47cc LB |
20 | |
21 | fn main() { | |
9cc50fc6 SL |
22 | let d = Droppable(0); |
23 | mir(d); | |
223e47cc | 24 | } |