File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
compiler/rustc_session/src Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,14 @@ macro_rules! top_level_options {
101101 ) ;
102102}
103103
104+ impl Options {
105+ pub fn mir_opt_level ( & self ) -> usize {
106+ self . debugging_opts
107+ . mir_opt_level
108+ . unwrap_or_else ( || if self . optimize != OptLevel :: No { 2 } else { 1 } )
109+ }
110+ }
111+
104112top_level_options ! (
105113 /// The top-level command-line options struct.
106114 ///
Original file line number Diff line number Diff line change @@ -562,10 +562,7 @@ impl Session {
562562 self . opts . debugging_opts . binary_dep_depinfo
563563 }
564564 pub fn mir_opt_level ( & self ) -> usize {
565- self . opts
566- . debugging_opts
567- . mir_opt_level
568- . unwrap_or_else ( || if self . opts . optimize != config:: OptLevel :: No { 2 } else { 1 } )
565+ self . opts . mir_opt_level ( )
569566 }
570567
571568 /// Gets the features enabled for the current compilation session.
You can’t perform that action at this time.
0 commit comments