]> git.proxmox.com Git - rustc.git/blob - tests/run-make/coverage-reports/expected_show_coverage.generics.txt
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / run-make / coverage-reports / expected_show_coverage.generics.txt
1 1| |#![allow(unused_assignments)]
2 2| |// expect-exit-status-1
3 3| |
4 4| |struct Firework<T> where T: Copy + std::fmt::Display {
5 5| | strength: T,
6 6| |}
7 7| |
8 8| |impl<T> Firework<T> where T: Copy + std::fmt::Display {
9 9| | #[inline(always)]
10 10| 3| fn set_strength(&mut self, new_strength: T) {
11 11| 3| self.strength = new_strength;
12 12| 3| }
13 ------------------
14 | <generics::Firework<i32>>::set_strength:
15 | 10| 1| fn set_strength(&mut self, new_strength: T) {
16 | 11| 1| self.strength = new_strength;
17 | 12| 1| }
18 ------------------
19 | <generics::Firework<f64>>::set_strength:
20 | 10| 2| fn set_strength(&mut self, new_strength: T) {
21 | 11| 2| self.strength = new_strength;
22 | 12| 2| }
23 ------------------
24 13| |}
25 14| |
26 15| |impl<T> Drop for Firework<T> where T: Copy + std::fmt::Display {
27 16| | #[inline(always)]
28 17| 2| fn drop(&mut self) {
29 18| 2| println!("BOOM times {}!!!", self.strength);
30 19| 2| }
31 ------------------
32 | <generics::Firework<f64> as core::ops::drop::Drop>::drop:
33 | 17| 1| fn drop(&mut self) {
34 | 18| 1| println!("BOOM times {}!!!", self.strength);
35 | 19| 1| }
36 ------------------
37 | <generics::Firework<i32> as core::ops::drop::Drop>::drop:
38 | 17| 1| fn drop(&mut self) {
39 | 18| 1| println!("BOOM times {}!!!", self.strength);
40 | 19| 1| }
41 ------------------
42 20| |}
43 21| |
44 22| 1|fn main() -> Result<(),u8> {
45 23| 1| let mut firecracker = Firework { strength: 1 };
46 24| 1| firecracker.set_strength(2);
47 25| 1|
48 26| 1| let mut tnt = Firework { strength: 100.1 };
49 27| 1| tnt.set_strength(200.1);
50 28| 1| tnt.set_strength(300.3);
51 29| 1|
52 30| 1| if true {
53 31| 1| println!("Exiting with error...");
54 32| 1| return Err(1);
55 33| 0| }
56 34| 0|
57 35| 0|
58 36| 0|
59 37| 0|
60 38| 0|
61 39| 0| let _ = Firework { strength: 1000 };
62 40| 0|
63 41| 0| Ok(())
64 42| 1|}
65 43| |
66 44| |// Expected program output:
67 45| |// Exiting with error...
68 46| |// BOOM times 100!!!
69 47| |// BOOM times 1!!!
70 48| |// Error: 1
71