]> git.lizzy.rs Git - rust.git/blob - src/test/run-fail/mir_codegen_calls_diverging_drops.rs
Use better bound names in `-Zverbose` mode
[rust.git] / src / test / run-fail / mir_codegen_calls_diverging_drops.rs
1 // error-pattern:diverging_fn called
2 // error-pattern:0 dropped
3
4 struct Droppable(u8);
5 impl Drop for Droppable {
6     fn drop(&mut self) {
7         eprintln!("{} dropped", self.0);
8     }
9 }
10
11 fn diverging_fn() -> ! {
12     panic!("diverging_fn called")
13 }
14
15 fn mir(d: Droppable) {
16     diverging_fn();
17 }
18
19 fn main() {
20     let d = Droppable(0);
21     mir(d);
22 }