]> git.proxmox.com Git - rustc.git/blame - src/test/ui/mir/mir_codegen_calls_diverging_drops.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / mir / mir_codegen_calls_diverging_drops.rs
CommitLineData
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
6struct Droppable(u8);
7impl Drop for Droppable {
8 fn drop(&mut self) {
abe05a73 9 eprintln!("{} dropped", self.0);
9cc50fc6
SL
10 }
11}
223e47cc 12
9cc50fc6
SL
13fn diverging_fn() -> ! {
14 panic!("diverging_fn called")
15}
85aaf69f 16
9cc50fc6
SL
17fn mir(d: Droppable) {
18 diverging_fn();
85aaf69f 19}
223e47cc
LB
20
21fn main() {
9cc50fc6
SL
22 let d = Droppable(0);
23 mir(d);
223e47cc 24}