]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mir/mir_codegen_calls_diverging_drops.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / mir / mir_codegen_calls_diverging_drops.rs
1 // run-fail
2 // error-pattern:diverging_fn called
3 // error-pattern:0 dropped
4 // ignore-emscripten no processes
5
6 struct Droppable(u8);
7 impl Drop for Droppable {
8     fn drop(&mut self) {
9         eprintln!("{} dropped", self.0);
10     }
11 }
12
13 fn diverging_fn() -> ! {
14     panic!("diverging_fn called")
15 }
16
17 fn mir(d: Droppable) {
18     diverging_fn();
19 }
20
21 fn main() {
22     let d = Droppable(0);
23     mir(d);
24 }