File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
compiler/rustc_mir_build/src/build Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,14 @@ pub(crate) fn make_coverage_hir_info_if_eligible(
17
17
}
18
18
19
19
fn is_eligible_for_coverage(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
20
- let is_fn_like = tcx.hir().get_by_def_id(def_id).fn_kind().is_some();
21
-
22
20
// Only instrument functions, methods, and closures (not constants since they are evaluated
23
21
// at compile time by Miri).
24
22
// FIXME(#73156): Handle source code coverage in const eval, but note, if and when const
25
23
// expressions get coverage spans, we will probably have to "carve out" space for const
26
24
// expressions from coverage spans in enclosing MIR's, like we do for closures. (That might
27
25
// be tricky if const expressions have no corresponding statements in the enclosing MIR.
28
26
// Closures are carved out by their initial `Assign` statement.)
29
- if !is_fn_like {
27
+ if !tcx.def_kind(def_id). is_fn_like() {
30
28
return false;
31
29
}
32
30
You can’t perform that action at this time.
0 commit comments