about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/remove_zsts.rs
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2021-12-02 09:17:32 -0800
committerDylan MacKenzie <ecstaticmorse@gmail.com>2021-12-02 17:31:38 -0800
commitfd18b45e112d07c20d12303aa5d7d7ffd28830b7 (patch)
tree539aa8d26fb7341c8f5f989b44bf831570da82c3 /compiler/rustc_mir_transform/src/remove_zsts.rs
parentc1a501b131ae99cb139b0843125f27d548b4cd1b (diff)
downloadrust-fd18b45e112d07c20d12303aa5d7d7ffd28830b7.tar.gz
rust-fd18b45e112d07c20d12303aa5d7d7ffd28830b7.zip
Update passes with new interface
Diffstat (limited to 'compiler/rustc_mir_transform/src/remove_zsts.rs')
-rw-r--r--compiler/rustc_mir_transform/src/remove_zsts.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/remove_zsts.rs b/compiler/rustc_mir_transform/src/remove_zsts.rs
index d93ffa38c69..1d912e61409 100644
--- a/compiler/rustc_mir_transform/src/remove_zsts.rs
+++ b/compiler/rustc_mir_transform/src/remove_zsts.rs
@@ -8,6 +8,10 @@ use rustc_middle::ty::{self, Ty, TyCtxt};
 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() {