diff options
| author | bors <bors@rust-lang.org> | 2024-03-13 07:17:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-13 07:17:22 +0000 |
| commit | 762d3170f6d17b541b9306bae1502cef329168e1 (patch) | |
| tree | b822140a2e67628477ac0b2090f68f23313375fa /compiler/rustc_codegen_llvm | |
| parent | 5a6c1aa2bccfcbfa42f486a54c09bd698378faef (diff) | |
| parent | 62e9e46937895e56571957151dce6d865f90f147 (diff) | |
| download | rust-762d3170f6d17b541b9306bae1502cef329168e1.tar.gz rust-762d3170f6d17b541b9306bae1502cef329168e1.zip | |
Auto merge of #122423 - matthiaskrgr:rollup-qywgl45, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #121820 (pattern analysis: Store field indices in `DeconstructedPat` to avoid virtual wildcards) - #121908 (match lowering: don't collect test alternatives ahead of time) - #122203 (Add `intrinsic_name` to get plain intrinsic name) - #122226 (coverage: Remove or migrate all unstable values of `-Cinstrument-coverage`) - #122255 (Use `min_exhaustive_patterns` in core & std) - #122360 ( Don't Create `ParamCandidate` When Obligation Contains Errors ) - #122383 (Enable PR tracking review assignment for rust-lang/rust) - #122386 (Move `Once` implementations to `sys`) - #122400 (Fix ICE in diagnostics for parenthesized type arguments) - #122410 (rustdoc: do not preload fonts when browsing locally) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs index c45787f35aa..ee7ea342301 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs @@ -355,21 +355,20 @@ fn add_unused_functions(cx: &CodegenCx<'_, '_>) { let tcx = cx.tcx; - let ignore_unused_generics = tcx.sess.instrument_coverage_except_unused_generics(); - let eligible_def_ids = tcx.mir_keys(()).iter().filter_map(|local_def_id| { let def_id = local_def_id.to_def_id(); let kind = tcx.def_kind(def_id); // `mir_keys` will give us `DefId`s for all kinds of things, not // just "functions", like consts, statics, etc. Filter those out. - // If `ignore_unused_generics` was specified, filter out any - // generic functions from consideration as well. if !matches!(kind, DefKind::Fn | DefKind::AssocFn | DefKind::Closure) { return None; } - if ignore_unused_generics && tcx.generics_of(def_id).requires_monomorphization(tcx) { - return None; - } + + // FIXME(79651): Consider trying to filter out dummy instantiations of + // unused generic functions from library crates, because they can produce + // "unused instantiation" in coverage reports even when they are actually + // used by some downstream crate in the same binary. + Some(local_def_id.to_def_id()) }); |
