]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.partial_eq.txt
rustdoc-json: Make the `fns/generics.rs` test much more robust
[rust.git] / src / test / run-make-fulldeps / coverage-reports / expected_show_coverage.partial_eq.txt
1     1|       |// This test confirms an earlier problem was resolved, supporting the MIR graph generated by the
2     2|       |// structure of this test.
3     3|       |
4     4|      2|#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
5                        ^0            ^0      ^0     ^1       ^1 ^0^0
6   ------------------
7   | Unexecuted instantiation: <partial_eq::Version as core::cmp::PartialEq>::ne
8   ------------------
9   | Unexecuted instantiation: <partial_eq::Version as core::cmp::PartialEq>::eq
10   ------------------
11     5|       |pub struct Version {
12     6|       |    major: usize,
13     7|       |    minor: usize,
14     8|       |    patch: usize,
15     9|       |}
16    10|       |
17    11|       |impl Version {
18    12|      2|    pub fn new(major: usize, minor: usize, patch: usize) -> Self {
19    13|      2|        Self {
20    14|      2|            major,
21    15|      2|            minor,
22    16|      2|            patch,
23    17|      2|        }
24    18|      2|    }
25    19|       |}
26    20|       |
27    21|      1|fn main() {
28    22|      1|    let version_3_2_1 = Version::new(3, 2, 1);
29    23|      1|    let version_3_3_0 = Version::new(3, 3, 0);
30    24|      1|
31    25|      1|    println!("{:?} < {:?} = {}", version_3_2_1, version_3_3_0, version_3_2_1 < version_3_3_0);
32    26|      1|}
33    27|       |
34    28|       |/*
35    29|       |
36    30|       |This test verifies a bug was fixed that otherwise generated this error:
37    31|       |
38    32|       |thread 'rustc' panicked at 'No counters provided the source_hash for function:
39    33|       |    Instance {
40    34|       |        def: Item(WithOptConstParam {
41    35|       |            did: DefId(0:101 ~ autocfg[c44a]::version::{impl#2}::partial_cmp),
42    36|       |            const_param_did: None
43    37|       |        }),
44    38|       |        substs: []
45    39|       |    }'
46    40|       |The `PartialOrd` derived by `Version` happened to generate a MIR that generated coverage
47    41|       |without a code region associated with any `Counter`. Code regions were associated with at least
48    42|       |one expression, which is allowed, but the `function_source_hash` was only passed to the codegen
49    43|       |(coverage mapgen) phase from a `Counter`s code region. A new method was added to pass the
50    44|       |`function_source_hash` without a code region, if necessary.
51    45|       |
52    46|       |*/
53