File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
compiler/rustc_codegen_llvm/src/coverageinfo Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -271,16 +271,14 @@ fn add_unused_functions(cx: &CodegenCx<'_, '_>) {
271271 let usage = prepare_usage_sets ( tcx) ;
272272
273273 let is_unused_fn = |def_id : LocalDefId | -> bool {
274- let def_id = def_id. to_def_id ( ) ;
275-
276- // To be eligible for "unused function" mappings, a definition must:
277- // - Be function-like
274+ // To be potentially eligible for "unused function" mappings, a definition must:
275+ // - Be eligible for coverage instrumentation
278276 // - Not participate directly in codegen (or have lost all its coverage statements)
279277 // - Not have any coverage statements inlined into codegenned functions
280- tcx. def_kind ( def_id) . is_fn_like ( )
281- && ( !usage. all_mono_items . contains ( & def_id)
282- || usage. missing_own_coverage . contains ( & def_id) )
283- && !usage. used_via_inlining . contains ( & def_id)
278+ tcx. is_eligible_for_coverage ( def_id)
279+ && ( !usage. all_mono_items . contains ( & def_id. to_def_id ( ) )
280+ || usage. missing_own_coverage . contains ( & def_id. to_def_id ( ) ) )
281+ && !usage. used_via_inlining . contains ( & def_id. to_def_id ( ) )
284282 } ;
285283
286284 // Scan for unused functions that were instrumented for coverage.
You can’t perform that action at this time.
0 commit comments