1 1| |// This test confirms an earlier problem was resolved, supporting the MIR graph generated by the
2 2| |// structure of this test.
4 4| 2|#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
7 | Unexecuted instantiation: <partial_eq::Version as core::cmp::PartialEq>::ne
9 | Unexecuted instantiation: <partial_eq::Version as core::cmp::PartialEq>::eq
11 5| |pub struct Version {
18 12| 2| pub fn new(major: usize, minor: usize, patch: usize) -> Self {
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);
31 25| 1| println!("{:?} < {:?} = {}", version_3_2_1, version_3_3_0, version_3_2_1 < version_3_3_0);
36 30| |This test verifies a bug was fixed that otherwise generated this error:
38 32| |thread 'rustc' panicked at 'No counters provided the source_hash for function:
40 34| | def: Item(WithOptConstParam {
41 35| | did: DefId(0:101 ~ autocfg[c44a]::version::{impl#2}::partial_cmp),
42 36| | const_param_did: None
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.