]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_transform/src/remove_zsts.rs
Rollup merge of #90132 - joshtriplett:stabilize-instrument-coverage, r=wesleywiser
[rust.git] / compiler / rustc_mir_transform / src / remove_zsts.rs
index d93ffa38c69066f40a5cced0b7bcf479b6993cea..1d912e6140989b7205866dc5433d587d8aac821e 100644 (file)
@@ -8,6 +8,10 @@
 pub struct RemoveZsts;
 
 impl<'tcx> MirPass<'tcx> for RemoveZsts {
+    fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
+        sess.mir_opt_level() > 0
+    }
+
     fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
         // Avoid query cycles (generators require optimized MIR for layout).
         if tcx.type_of(body.source.def_id()).is_generator() {