]>
git.proxmox.com Git - rustc.git/blob - src/test/run-make/coverage/partial_eq.rs
1 // This test confirms an earlier problem was resolved, supporting the MIR graph generated by the
2 // structure of this test.
4 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
12 pub fn new(major
: usize, minor
: usize, patch
: usize) -> Self {
22 let version_3_2_1
= Version
::new(3, 2, 1);
23 let version_3_3_0
= Version
::new(3, 3, 0);
25 println
!("{:?} < {:?} = {}", version_3_2_1
, version_3_3_0
, version_3_2_1
< version_3_3_0
);
30 This test verifies a bug was fixed that otherwise generated this error:
32 thread 'rustc' panicked at 'No counters provided the source_hash for function:
34 def: Item(WithOptConstParam {
35 did: DefId(0:101 ~ autocfg[c44a]::version::{impl#2}::partial_cmp),
40 The `PartialOrd` derived by `Version` happened to generate a MIR that generated coverage
41 without a code region associated with any `Counter`. Code regions were associated with at least
42 one expression, which is allowed, but the `function_source_hash` was only passed to the codegen
43 (coverage mapgen) phase from a `Counter`s code region. A new method was added to pass the
44 `function_source_hash` without a code region, if necessary.