Skip to content

Commit 6dec8dd

Browse files
committed
Derived Eq no longer shows uncovered
The Eq trait has a special hidden function. MIR `InstrumentCoverage` would add this function to the coverage map, but it is never called, so the `Eq` trait would always appear uncovered. Fixes: rust-lang#83601 The fix required creating a new function attribute `no_coverage` to mark functions that should be ignored by `InstrumentCoverage` and the coverage `mapgen` (during codegen). While testing, I also noticed two other issues: * spanview debug file output ICEd on a function with no body. The workaround for this is included in this PR. * `assert_*!()` macro coverage can appear covered if followed by another `assert_*!()` macro. Normally they appear uncovered. I submitted a new Issue rust-lang#84561, and added a coverage test to demonstrate this issue.
1 parent 7146f37 commit 6dec8dd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/cmp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ pub trait Eq: PartialEq<Self> {
274274
//
275275
// This should never be implemented by hand.
276276
#[doc(hidden)]
277+
#[cfg_attr(not(bootstrap), no_coverage)]
277278
#[inline]
278279
#[stable(feature = "rust1", since = "1.0.0")]
279280
fn assert_receiver_is_total_eq(&self) {}

0 commit comments

Comments
 (0)