diff options
| author | bors <bors@rust-lang.org> | 2025-07-28 16:38:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-28 16:38:15 +0000 |
| commit | e3514bde96d2d13586337a48db77fa64b850d249 (patch) | |
| tree | 4b7ae3db59d7fc366645a22c922598df2970357d /compiler/rustc_mir_transform/src/coverage | |
| parent | 9ba00e0f9e00990fb88c1beac7172afe93b15609 (diff) | |
| parent | cdcfdd1a1b3f267a98c693fc03b4411934b60674 (diff) | |
| download | rust-e3514bde96d2d13586337a48db77fa64b850d249.tar.gz rust-e3514bde96d2d13586337a48db77fa64b850d249.zip | |
Auto merge of #144377 - camsteffen:simplify-impl-of-method, r=fee1-dead
Rename impl_of_method and trait_of_item This PR used to tweak the implementation of impl_of_method, but that introduced a perf regression. Rename impl_of_method and trait_of_item to impl_of_assoc and trait_of_assoc respectively. This reflects how the two functions are closely related. And it reflects the behavior more accurately as the functions check whether the input is an associated item.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coverage/query.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/query.rs b/compiler/rustc_mir_transform/src/coverage/query.rs index 986c001de5e..551f720c869 100644 --- a/compiler/rustc_mir_transform/src/coverage/query.rs +++ b/compiler/rustc_mir_transform/src/coverage/query.rs @@ -35,7 +35,7 @@ fn is_eligible_for_coverage(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool { // Don't instrument functions with `#[automatically_derived]` on their // enclosing impl block, on the assumption that most users won't care about // coverage for derived impls. - if let Some(impl_of) = tcx.impl_of_method(def_id.to_def_id()) + if let Some(impl_of) = tcx.impl_of_assoc(def_id.to_def_id()) && tcx.is_automatically_derived(impl_of) { trace!("InstrumentCoverage skipped for {def_id:?} (automatically derived)"); |
