about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2024-11-24 18:36:15 +1100
committerZalathar <Zalathar@users.noreply.github.com>2024-11-24 23:28:02 +1100
commit619a272612ff6259737fa26bf8770474c26d66d7 (patch)
tree18d794df23b9783886fac0c0f6856f86ad2dc0d5 /compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
parent15b663e684d0acf1b4299b7ad6b4f4ab106395bd (diff)
downloadrust-619a272612ff6259737fa26bf8770474c26d66d7.tar.gz
rust-619a272612ff6259737fa26bf8770474c26d66d7.zip
coverage: Ignore functions that end up having no mappings
A used function with no mappings has historically indicated a bug, but that
will no longer be the case after moving some fallible span-processing steps
into codegen.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
index b582dd967a7..5438cefefad 100644
--- a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
+++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
@@ -103,15 +103,8 @@ pub(crate) fn finalize(cx: &CodegenCx<'_, '_>) {
             encode_mappings_for_function(tcx, &global_file_table, &function_coverage);
 
         if coverage_mapping_buffer.is_empty() {
-            if function_coverage.is_used() {
-                bug!(
-                    "A used function should have had coverage mapping data but did not: {}",
-                    mangled_function_name
-                );
-            } else {
-                debug!("unused function had no coverage mapping data: {}", mangled_function_name);
-                continue;
-            }
+            debug!("function has no mappings to embed; skipping");
+            continue;
         }
 
         if !is_used {