]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.loops_branches.txt
Auto merge of #83610 - bjorn3:driver_cleanup, r=cjgillot
[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|       |                while true {
13    13|       |                }
14    14|      1|            }
15    15|      1|            write!(f, "error")?;
16                                             ^0
17    16|       |        } else {
18    17|       |        }
19    18|       |
20    19|     10|        for i in 0..10 {
21    20|     10|            if true {
22    21|     10|                if false {
23    22|       |                    while true {}
24    23|     10|                }
25    24|     10|                write!(f, "error")?;
26                                                 ^0
27    25|       |            } else {
28    26|       |            }
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|       |        } else {
40    38|      1|            if false {
41    39|       |                while true {}
42    40|      1|            }
43    41|      1|            write!(f, "error")?;
44                                             ^0
45    42|       |        }
46    43|     10|        for i in 0..10 {
47    44|     10|            if false {
48    45|       |            } else {
49    46|     10|                if false {
50    47|       |                    while true {}
51    48|     10|                }
52    49|     10|                write!(f, "error")?;
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