@@ -5,14 +5,14 @@ use rustc_hir::LangItem;
5
5
use rustc_index:: IndexVec ;
6
6
use rustc_index:: bit_set:: BitSet ;
7
7
use rustc_infer:: infer:: TyCtxtInferExt ;
8
- use rustc_infer:: traits:: { Obligation , ObligationCause , Reveal } ;
8
+ use rustc_infer:: traits:: { Obligation , ObligationCause } ;
9
9
use rustc_middle:: mir:: coverage:: CoverageKind ;
10
10
use rustc_middle:: mir:: visit:: { NonUseContext , PlaceContext , Visitor } ;
11
11
use rustc_middle:: mir:: * ;
12
12
use rustc_middle:: ty:: adjustment:: PointerCoercion ;
13
13
use rustc_middle:: ty:: {
14
14
self , CoroutineArgsExt , InstanceKind , ParamEnv , ScalarInt , Ty , TyCtxt , TypeVisitableExt ,
15
- TypingMode , Variance ,
15
+ Variance ,
16
16
} ;
17
17
use rustc_middle:: { bug, span_bug} ;
18
18
use rustc_target:: abi:: { FIRST_VARIANT , Size } ;
@@ -50,11 +50,7 @@ impl<'tcx> crate::MirPass<'tcx> for Validator {
50
50
}
51
51
let def_id = body. source . def_id ( ) ;
52
52
let mir_phase = self . mir_phase ;
53
- let param_env = match mir_phase. reveal ( ) {
54
- Reveal :: UserFacing => tcx. param_env ( def_id) ,
55
- Reveal :: All => tcx. param_env_reveal_all_normalized ( def_id) ,
56
- } ;
57
-
53
+ let param_env = mir_phase. param_env ( tcx, def_id) ;
58
54
let can_unwind = if mir_phase <= MirPhase :: Runtime ( RuntimePhase :: Initial ) {
59
55
// In this case `AbortUnwindingCalls` haven't yet been executed.
60
56
true
@@ -606,7 +602,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
606
602
return true ;
607
603
}
608
604
609
- let infcx = self . tcx . infer_ctxt ( ) . build ( TypingMode :: from_param_env ( self . param_env ) ) ;
605
+ let infcx = self . tcx . infer_ctxt ( ) . build ( self . body . phase . typing_mode ( ) ) ;
610
606
let ocx = ObligationCtxt :: new ( & infcx) ;
611
607
ocx. register_obligation ( Obligation :: new (
612
608
self . tcx ,
0 commit comments