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