]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.loops_branches.txt
Rollup merge of #85018 - hi-rustin:rustin-patch-84637, r=estebank
[rust.git] / src / test / run-make-fulldeps / coverage-reports / expected_show_coverage.loops_branches.txt
1     1|       |#![allow(unused_assignments, unused_variables, while_true)]
2     2|       |
3     3|       |// This test confirms that (1) unexecuted infinite loops are handled correctly by the
4     4|       |// InstrumentCoverage MIR pass; and (2) Counter Expressions that subtract from zero can be dropped.
5     5|       |
6     6|       |struct DebugTest;
7     7|       |
8     8|       |impl std::fmt::Debug for DebugTest {
9     9|      1|    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
10    10|      1|        if true {
11    11|      1|            if false {
12    12|      0|                while true {
13    13|      0|                }
14    14|      1|            }
15    15|      1|            write!(f, "cool")?;
16                                            ^0
17    16|      0|        } else {
18    17|      0|        }
19    18|       |
20    19|     10|        for i in 0..10 {
21    20|     10|            if true {
22    21|     10|                if false {
23    22|      0|                    while true {}
24    23|     10|                }
25    24|     10|                write!(f, "cool")?;
26                                                ^0
27    25|      0|            } else {
28    26|      0|            }
29    27|       |        }
30    28|      1|        Ok(())
31    29|      1|    }
32    30|       |}
33    31|       |
34    32|       |struct DisplayTest;
35    33|       |
36    34|       |impl std::fmt::Display for DisplayTest {
37    35|      1|    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
38    36|      1|        if false {
39    37|      0|        } else {
40    38|      1|            if false {
41    39|      0|                while true {}
42    40|      1|            }
43    41|      1|            write!(f, "cool")?;
44                                            ^0
45    42|       |        }
46    43|     10|        for i in 0..10 {
47    44|     10|            if false {
48    45|      0|            } else {
49    46|     10|                if false {
50    47|      0|                    while true {}
51    48|     10|                }
52    49|     10|                write!(f, "cool")?;
53                                                ^0
54    50|       |            }
55    51|       |        }
56    52|      1|        Ok(())
57    53|      1|    }
58    54|       |}
59    55|       |
60    56|      1|fn main() {
61    57|      1|    let debug_test = DebugTest;
62    58|      1|    println!("{:?}", debug_test);
63    59|      1|    let display_test = DisplayTest;
64    60|      1|    println!("{}", display_test);
65    61|      1|}
66