1
Fork 0

fix: skip opt if body has tainted error

This commit is contained in:
bohan 2023-09-13 22:54:22 +08:00
parent 735bb7e5df
commit 7c53e87d55
3 changed files with 37 additions and 0 deletions

View file

@ -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