From 94a3454b0318e506e167f67aa52df1d054c6500b Mon Sep 17 00:00:00 2001 From: Rich Kadel Date: Tue, 23 Mar 2021 00:33:57 -0700 Subject: [PATCH] Change def_id filter to use requires_monomorphization() Per @wesleywiser's comment: https://github.com/rust-lang/rust/pull/83307#discussion_r599223342 --- compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs index 239f786a727..2ac814bf228 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs @@ -269,7 +269,7 @@ fn add_unused_functions<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) { .iter() .filter_map(|local_def_id| { let def_id = local_def_id.to_def_id(); - if ignore_unused_generics && tcx.generics_of(def_id).count() > 0 { + if ignore_unused_generics && tcx.generics_of(def_id).requires_monomorphization(tcx) { return None; } Some(local_def_id.to_def_id())