Skip to content

Commit

Permalink
Make mir_opt_level default to 2 for optimized levels
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Mar 3, 2021
1 parent 4bf42c8 commit 10d0109
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,10 @@ impl Session {
self.opts.debugging_opts.binary_dep_depinfo
}
pub fn mir_opt_level(&self) -> usize {
self.opts.debugging_opts.mir_opt_level.unwrap_or(1)
self.opts
.debugging_opts
.mir_opt_level
.unwrap_or_else(|| if self.opts.optimize != config::OptLevel::No { 2 } else { 1 })
}

/// Gets the features enabled for the current compilation session.
Expand Down

0 comments on commit 10d0109

Please sign in to comment.