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(
1717}
1818
1919fn 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-
2220 // Only instrument functions, methods, and closures (not constants since they are evaluated
2321 // at compile time by Miri).
2422 // FIXME(#73156): Handle source code coverage in const eval, but note, if and when const
2523 // expressions get coverage spans, we will probably have to "carve out" space for const
2624 // expressions from coverage spans in enclosing MIR's, like we do for closures. (That might
2725 // be tricky if const expressions have no corresponding statements in the enclosing MIR.
2826 // Closures are carved out by their initial `Assign` statement.)
29- if !is_fn_like {
27+ if !tcx . def_kind ( def_id ) . is_fn_like ( ) {
3028 return false ;
3129 }
3230
You can’t perform that action at this time.
0 commit comments