diff --git a/src/librustc_mir/transform/mod.rs b/src/librustc_mir/transform/mod.rs index 95a5752348374..af9436d404180 100644 --- a/src/librustc_mir/transform/mod.rs +++ b/src/librustc_mir/transform/mod.rs @@ -191,6 +191,11 @@ pub fn run_passes( } body.phase = mir_phase; + + if mir_phase == MirPhase::Optimized { + validate::Validator { when: format!("end of phase {:?}", mir_phase) } + .run_pass(tcx, source, body); + } } fn mir_const_qualif(tcx: TyCtxt<'_>, def_id: DefId) -> ConstQualifs {