Skip to content

Commit 619a272

Browse files
committed
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.
1 parent 15b663e commit 619a272

File tree

1 file changed

+2
-9
lines changed
  • compiler/rustc_codegen_llvm/src/coverageinfo

1 file changed

+2
-9
lines changed

compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,8 @@ pub(crate) fn finalize(cx: &CodegenCx<'_, '_>) {
103103
encode_mappings_for_function(tcx, &global_file_table, &function_coverage);
104104

105105
if coverage_mapping_buffer.is_empty() {
106-
if function_coverage.is_used() {
107-
bug!(
108-
"A used function should have had coverage mapping data but did not: {}",
109-
mangled_function_name
110-
);
111-
} else {
112-
debug!("unused function had no coverage mapping data: {}", mangled_function_name);
113-
continue;
114-
}
106+
debug!("function has no mappings to embed; skipping");
107+
continue;
115108
}
116109

117110
if !is_used {

0 commit comments

Comments
 (0)