Skip to content

Commit 10d0109

Browse files
committed
Make mir_opt_level default to 2 for optimized levels
1 parent 4bf42c8 commit 10d0109

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_session/src/session.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,10 @@ impl Session {
641641
self.opts.debugging_opts.binary_dep_depinfo
642642
}
643643
pub fn mir_opt_level(&self) -> usize {
644-
self.opts.debugging_opts.mir_opt_level.unwrap_or(1)
644+
self.opts
645+
.debugging_opts
646+
.mir_opt_level
647+
.unwrap_or_else(|| if self.opts.optimize != config::OptLevel::No { 2 } else { 1 })
645648
}
646649

647650
/// Gets the features enabled for the current compilation session.

0 commit comments

Comments
 (0)