]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/coverage/drop_trait.rs
Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-subtree
[rust.git] / src / test / run-make-fulldeps / coverage / drop_trait.rs
1 #![allow(unused_assignments)]
2 // expect-exit-status-1
3
4 struct Firework {
5     strength: i32,
6 }
7
8 impl Drop for Firework {
9     fn drop(&mut self) {
10         println!("BOOM times {}!!!", self.strength);
11     }
12 }
13
14 fn main() -> Result<(),u8> {
15     let _firecracker = Firework { strength: 1 };
16
17     let _tnt = Firework { strength: 100 };
18
19     if true {
20         println!("Exiting with error...");
21         return Err(1);
22     }
23
24     let _ = Firework { strength: 1000 };
25
26     Ok(())
27 }
28
29 // Expected program output:
30 //   Exiting with error...
31 //   BOOM times 100!!!
32 //   BOOM times 1!!!
33 //   Error: 1