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 {
101
101
) ;
102
102
}
103
103
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
+
104
112
top_level_options ! (
105
113
/// The top-level command-line options struct.
106
114
///
Original file line number Diff line number Diff line change @@ -562,10 +562,7 @@ impl Session {
562
562
self . opts . debugging_opts . binary_dep_depinfo
563
563
}
564
564
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 ( )
569
566
}
570
567
571
568
/// Gets the features enabled for the current compilation session.
You can’t perform that action at this time.
0 commit comments