@@ -5,14 +5,14 @@ use rustc_hir::LangItem;
55use rustc_index:: IndexVec ;
66use rustc_index:: bit_set:: BitSet ;
77use rustc_infer:: infer:: TyCtxtInferExt ;
8- use rustc_infer:: traits:: { Obligation , ObligationCause , Reveal } ;
8+ use rustc_infer:: traits:: { Obligation , ObligationCause } ;
99use rustc_middle:: mir:: coverage:: CoverageKind ;
1010use rustc_middle:: mir:: visit:: { NonUseContext , PlaceContext , Visitor } ;
1111use rustc_middle:: mir:: * ;
1212use rustc_middle:: ty:: adjustment:: PointerCoercion ;
1313use rustc_middle:: ty:: {
1414 self , CoroutineArgsExt , InstanceKind , ParamEnv , ScalarInt , Ty , TyCtxt , TypeVisitableExt ,
15- TypingMode , Variance ,
15+ Variance ,
1616} ;
1717use rustc_middle:: { bug, span_bug} ;
1818use rustc_target:: abi:: { FIRST_VARIANT , Size } ;
@@ -50,11 +50,7 @@ impl<'tcx> crate::MirPass<'tcx> for Validator {
5050 }
5151 let def_id = body. source . def_id ( ) ;
5252 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) ;
5854 let can_unwind = if mir_phase <= MirPhase :: Runtime ( RuntimePhase :: Initial ) {
5955 // In this case `AbortUnwindingCalls` haven't yet been executed.
6056 true
@@ -606,7 +602,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
606602 return true ;
607603 }
608604
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 ( ) ) ;
610606 let ocx = ObligationCtxt :: new ( & infcx) ;
611607 ocx. register_obligation ( Obligation :: new (
612608 self . tcx ,
0 commit comments