coverage: Avoid ICE when coverage_cx is unexpectedly unavailable
This commit is contained in:
@@ -152,7 +152,12 @@ impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> {
|
||||
return;
|
||||
};
|
||||
|
||||
let mut coverage_map = bx.coverage_cx().function_coverage_map.borrow_mut();
|
||||
// FIXME(#132395): Unwrapping `coverage_cx` here has led to ICEs in the
|
||||
// wild, so keep this early-return until we understand why.
|
||||
let mut coverage_map = match bx.coverage_cx {
|
||||
Some(ref cx) => cx.function_coverage_map.borrow_mut(),
|
||||
None => return,
|
||||
};
|
||||
let func_coverage = coverage_map
|
||||
.entry(instance)
|
||||
.or_insert_with(|| FunctionCoverageCollector::new(instance, function_coverage_info));
|
||||
|
||||
Reference in New Issue
Block a user