Skip to content

Commit 743c8c7

Browse files
committed
Auto merge of rust-lang#84562 - richkadel:issue-83601, r=tmandry
Adds feature-gated `#[no_coverage]` function attribute, to fix derived Eq `0` coverage issue rust-lang#83601 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). Adding a `no_coverage` feature gate with tracking issue rust-lang#84605. r? `@tmandry` cc: `@wesleywiser`
2 parents 649ab15 + 68c7b89 commit 743c8c7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/cmp.rs

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

0 commit comments

Comments
 (0)