@@ -7,15 +7,14 @@ use rustc_hir::def_id::LocalDefId;
7
7
use rustc_hir:: HirIdMap ;
8
8
use rustc_infer:: infer;
9
9
use rustc_infer:: infer:: { InferCtxt , InferOk , TyCtxtInferExt } ;
10
- use rustc_infer:: traits:: TraitEngineExt as _;
11
10
use rustc_middle:: ty:: fold:: TypeFoldable ;
12
11
use rustc_middle:: ty:: visit:: TypeVisitable ;
13
12
use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
14
13
use rustc_span:: def_id:: LocalDefIdMap ;
15
14
use rustc_span:: { self , Span } ;
16
15
use rustc_trait_selection:: infer:: InferCtxtExt as _;
17
16
use rustc_trait_selection:: traits:: {
18
- self , FulfillmentContext , ObligationCause , TraitEngine , TraitEngineExt as _,
17
+ self , ObligationCause , ObligationCtxt , TraitEngine , TraitEngineExt as _,
19
18
} ;
20
19
21
20
use std:: cell:: RefCell ;
@@ -94,17 +93,14 @@ impl<'tcx> Inherited<'_, 'tcx> {
94
93
return fn_sig;
95
94
}
96
95
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 ( ) {
108
104
let normalized_fn_sig =
109
105
infcx. resolve_vars_if_possible ( normalized_fn_sig) ;
110
106
if !normalized_fn_sig. needs_infer ( ) {
0 commit comments