]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_transform/src/lower_slice_len.rs
Rollup merge of #93824 - Amanieu:stable_cfg_target_has_atomic, r=davidtwco
[rust.git] / compiler / rustc_mir_transform / src / lower_slice_len.rs
index 822a372d8ce90fa1a11d043fe96da70e1072f750..c8297744873087256dc9c4e2eb66582303b37af5 100644 (file)
 pub struct LowerSliceLenCalls;
 
 impl<'tcx> MirPass<'tcx> for LowerSliceLenCalls {
+    fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
+        sess.opts.mir_opt_level() > 0
+    }
+
     fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
         lower_slice_len_calls(tcx, body)
     }