@@ -95,7 +95,7 @@ pub enum IntercrateMode {
9595}
9696
9797/// The mode that trait queries run in.
98- #[ derive( Copy , Clone , PartialEq , Eq , Debug , Hash , HashStable ) ]
98+ #[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
9999pub enum TraitQueryMode {
100100 // Standard/un-canonicalized queries get accurate
101101 // spans etc. passed in and hence can do reasonable
@@ -1014,17 +1014,16 @@ where
10141014/// environment. If this returns false, then either normalize
10151015/// encountered an error or one of the predicates did not hold. Used
10161016/// when creating vtables to check for unsatisfiable methods.
1017- fn normalize_and_test_predicates < ' tcx > (
1017+ pub fn normalize_and_test_predicates < ' tcx > (
10181018 tcx : TyCtxt < ' tcx > ,
10191019 predicates : Vec < ty:: Predicate < ' tcx > > ,
1020- mode : TraitQueryMode ,
10211020) -> bool {
1022- debug ! ( "normalize_and_test_predicates(predicates={:?}, mode={:?} )" , predicates, mode ) ;
1021+ debug ! ( "normalize_and_test_predicates(predicates={:?})" , predicates) ;
10231022
10241023 let result = tcx. infer_ctxt ( ) . enter ( |infcx| {
10251024 let param_env = ty:: ParamEnv :: reveal_all ( ) ;
1026- let mut selcx = SelectionContext :: with_query_mode ( & infcx, mode ) ;
1027- let mut fulfill_cx = FulfillmentContext :: with_query_mode ( mode ) ;
1025+ let mut selcx = SelectionContext :: new ( & infcx) ;
1026+ let mut fulfill_cx = FulfillmentContext :: new ( ) ;
10281027 let cause = ObligationCause :: dummy ( ) ;
10291028 let Normalized { value : predicates, obligations } =
10301029 normalize ( & mut selcx, param_env, cause. clone ( ) , & predicates) ;
@@ -1044,12 +1043,12 @@ fn normalize_and_test_predicates<'tcx>(
10441043
10451044fn substitute_normalize_and_test_predicates < ' tcx > (
10461045 tcx : TyCtxt < ' tcx > ,
1047- key : ( DefId , SubstsRef < ' tcx > , TraitQueryMode ) ,
1046+ key : ( DefId , SubstsRef < ' tcx > ) ,
10481047) -> bool {
10491048 debug ! ( "substitute_normalize_and_test_predicates(key={:?})" , key) ;
10501049
10511050 let predicates = tcx. predicates_of ( key. 0 ) . instantiate ( tcx, key. 1 ) . predicates ;
1052- let result = normalize_and_test_predicates ( tcx, predicates, key . 2 ) ;
1051+ let result = normalize_and_test_predicates ( tcx, predicates) ;
10531052
10541053 debug ! ( "substitute_normalize_and_test_predicates(key={:?}) = {:?}" , key, result) ;
10551054 result
@@ -1102,10 +1101,7 @@ fn vtable_methods<'tcx>(
11021101 // Note that this method could then never be called, so we
11031102 // do not want to try and codegen it, in that case (see #23435).
11041103 let predicates = tcx. predicates_of ( def_id) . instantiate_own ( tcx, substs) ;
1105- // We don't expect overflow here, so report an error if it somehow ends
1106- // up happening.
1107- if !normalize_and_test_predicates ( tcx, predicates. predicates , TraitQueryMode :: Standard )
1108- {
1104+ if !normalize_and_test_predicates ( tcx, predicates. predicates ) {
11091105 debug ! ( "vtable_methods: predicates do not hold" ) ;
11101106 return None ;
11111107 }
0 commit comments