@@ -22,7 +22,6 @@ use rustc_middle::ty::subst::{InternalSubsts, Subst};
22
22
use rustc_middle:: ty:: {
23
23
self , ConstInt , ConstKind , Instance , ParamEnv , ScalarInt , Ty , TyCtxt , TypeFoldable ,
24
24
} ;
25
- use rustc_session:: config:: MIR_OPT_LEVEL_DEFAULT ;
26
25
use rustc_session:: lint;
27
26
use rustc_span:: { def_id:: DefId , Span } ;
28
27
use rustc_target:: abi:: { HasDataLayout , LayoutOf , Size , TargetDataLayout } ;
@@ -709,7 +708,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
709
708
return None ;
710
709
}
711
710
712
- if self . tcx . sess . opts . debugging_opts . mir_opt_level . unwrap_or ( MIR_OPT_LEVEL_DEFAULT ) >= 3 {
711
+ if self . tcx . sess . opts . debugging_opts . mir_opt_level >= 3 {
713
712
self . eval_rvalue_with_identities ( rvalue, place)
714
713
} else {
715
714
self . use_ecx ( |this| this. ecx . eval_rvalue_into_place ( rvalue, place) )
@@ -887,8 +886,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
887
886
888
887
/// Returns `true` if and only if this `op` should be const-propagated into.
889
888
fn should_const_prop ( & mut self , op : OpTy < ' tcx > ) -> bool {
890
- let mir_opt_level =
891
- self . tcx . sess . opts . debugging_opts . mir_opt_level . unwrap_or ( MIR_OPT_LEVEL_DEFAULT ) ;
889
+ let mir_opt_level = self . tcx . sess . opts . debugging_opts . mir_opt_level ;
892
890
893
891
if mir_opt_level == 0 {
894
892
return false ;
@@ -1058,7 +1056,7 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
1058
1056
1059
1057
// Only const prop copies and moves on `mir_opt_level=2` as doing so
1060
1058
// currently slightly increases compile time in some cases.
1061
- if self . tcx . sess . opts . debugging_opts . mir_opt_level . unwrap_or ( MIR_OPT_LEVEL_DEFAULT ) >= 2 {
1059
+ if self . tcx . sess . opts . debugging_opts . mir_opt_level >= 2 {
1062
1060
self . propagate_operand ( operand)
1063
1061
}
1064
1062
}
0 commit comments