@@ -7,15 +7,14 @@ use rustc_hir::def_id::LocalDefId;
77use rustc_hir:: HirIdMap ;
88use rustc_infer:: infer;
99use rustc_infer:: infer:: { InferCtxt , InferOk , TyCtxtInferExt } ;
10- use rustc_infer:: traits:: TraitEngineExt as _;
1110use rustc_middle:: ty:: fold:: TypeFoldable ;
1211use rustc_middle:: ty:: visit:: TypeVisitable ;
1312use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
1413use rustc_span:: def_id:: LocalDefIdMap ;
1514use rustc_span:: { self , Span } ;
1615use rustc_trait_selection:: infer:: InferCtxtExt as _;
1716use rustc_trait_selection:: traits:: {
18- self , FulfillmentContext , ObligationCause , TraitEngine , TraitEngineExt as _,
17+ self , ObligationCause , ObligationCtxt , TraitEngine , TraitEngineExt as _,
1918} ;
2019
2120use std:: cell:: RefCell ;
@@ -94,17 +93,14 @@ impl<'tcx> Inherited<'_, 'tcx> {
9493 return fn_sig;
9594 }
9695 infcx. probe ( |_| {
97- let traits:: Normalized { value : normalized_fn_sig, obligations } =
98- traits:: normalize (
99- & mut traits:: SelectionContext :: new ( infcx) ,
100- // FIXME(compiler-errors): This is probably not the right param-env...
101- infcx. tcx . param_env ( def_id) ,
102- ObligationCause :: dummy ( ) ,
103- fn_sig,
104- ) ;
105- let mut fulfillment_ctxt = FulfillmentContext :: new_in_snapshot ( ) ;
106- fulfillment_ctxt. register_predicate_obligations ( infcx, obligations) ;
107- if fulfillment_ctxt. select_all_or_error ( infcx) . is_empty ( ) {
96+ let ocx = ObligationCtxt :: new_in_snapshot ( infcx) ;
97+ let normalized_fn_sig = ocx. normalize (
98+ ObligationCause :: dummy ( ) ,
99+ // FIXME(compiler-errors): This is probably not the right param-env...
100+ infcx. tcx . param_env ( def_id) ,
101+ fn_sig,
102+ ) ;
103+ if ocx. select_all_or_error ( ) . is_empty ( ) {
108104 let normalized_fn_sig =
109105 infcx. resolve_vars_if_possible ( normalized_fn_sig) ;
110106 if !normalized_fn_sig. needs_infer ( ) {
0 commit comments