File: partial_eq.coverage

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,245,360 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (52 lines) | stat: -rw-r--r-- 2,183 bytes parent folder | download | duplicates (2)
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
   LL|       |// This test confirms an earlier problem was resolved, supporting the MIR graph generated by the
   LL|       |// structure of this test.
   LL|       |
   LL|       |#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
   LL|       |pub struct Version {
   LL|       |    major: usize,
   LL|       |    minor: usize,
   LL|       |    patch: usize,
   LL|       |}
   LL|       |
   LL|       |impl Version {
   LL|      2|    pub fn new(major: usize, minor: usize, patch: usize) -> Self {
   LL|      2|        Self {
   LL|      2|            major,
   LL|      2|            minor,
   LL|      2|            patch,
   LL|      2|        }
   LL|      2|    }
   LL|       |}
   LL|       |
   LL|      1|fn main() {
   LL|      1|    let version_3_2_1 = Version::new(3, 2, 1);
   LL|      1|    let version_3_3_0 = Version::new(3, 3, 0);
   LL|      1|
   LL|      1|    println!(
   LL|      1|        "{:?} < {:?} = {}",
   LL|      1|        version_3_2_1,
   LL|      1|        version_3_3_0,
   LL|      1|        version_3_2_1 < version_3_3_0
   LL|      1|    );
   LL|      1|}
   LL|       |
   LL|       |/*
   LL|       |
   LL|       |This test verifies a bug was fixed that otherwise generated this error:
   LL|       |
   LL|       |thread 'rustc' panicked at 'No counters provided the source_hash for function:
   LL|       |    Instance {
   LL|       |        def: Item(WithOptConstParam {
   LL|       |            did: DefId(0:101 ~ autocfg[c44a]::version::{impl#2}::partial_cmp),
   LL|       |            const_param_did: None
   LL|       |        }),
   LL|       |        args: []
   LL|       |    }'
   LL|       |The `PartialOrd` derived by `Version` happened to generate a MIR that generated coverage
   LL|       |without a code region associated with any `Counter`. Code regions were associated with at least
   LL|       |one expression, which is allowed, but the `function_source_hash` was only passed to the codegen
   LL|       |(coverage mapgen) phase from a `Counter`s code region. A new method was added to pass the
   LL|       |`function_source_hash` without a code region, if necessary.
   LL|       |
   LL|       |*/