Skip to content

Commit f75a236

Browse files
richkadelwesleywiser
andauthoredOct 23, 2020
Update compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
Co-authored-by: Wesley Wiser <wwiser@gmail.com>
1 parent a7bc1a2 commit f75a236

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_codegen_llvm/src/coverageinfo

1 file changed

+4
-4
lines changed
 

‎compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ use tracing::debug;
2626
/// undocumented details in Clang's implementation (that may or may not be important) were also
2727
/// replicated for Rust's Coverage Map.
2828
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();
29+
let function_coverage_map = match cx.coverage_context() {
30+
Some(ctx) => ctx.take_function_coverage_map(),
31+
None => return,
32+
};
3333
if function_coverage_map.is_empty() {
3434
// This module has no functions with coverage instrumentation
3535
return;

0 commit comments

Comments
 (0)
Please sign in to comment.