We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7bc1a2 commit f75a236Copy full SHA for f75a236
compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
@@ -26,10 +26,10 @@ use tracing::debug;
26
/// undocumented details in Clang's implementation (that may or may not be important) were also
27
/// replicated for Rust's Coverage Map.
28
pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
29
- if cx.coverage_context().is_none() {
30
- return;
31
- }
32
- let function_coverage_map = cx.coverage_context().unwrap().take_function_coverage_map();
+ let function_coverage_map = match cx.coverage_context() {
+ Some(ctx) => ctx.take_function_coverage_map(),
+ None => return,
+ };
33
if function_coverage_map.is_empty() {
34
// This module has no functions with coverage instrumentation
35
return;
0 commit comments