fix: skip opt if body has tainted error
This commit is contained in:
parent
735bb7e5df
commit
7c53e87d55
3 changed files with 37 additions and 0 deletions
|
@ -606,6 +606,11 @@ fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
|
|||
let body = tcx.mir_drops_elaborated_and_const_checked(did).steal();
|
||||
let mut body = remap_mir_for_const_eval_select(tcx, body, hir::Constness::NotConst);
|
||||
debug!("body: {:#?}", body);
|
||||
|
||||
if body.tainted_by_errors.is_some() {
|
||||
return body;
|
||||
}
|
||||
|
||||
run_optimization_passes(tcx, &mut body);
|
||||
|
||||
body
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue