@@ -344,7 +344,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
344344 {
345345 debug ! ( "instantiate_type_scheme(value={:?}, substs={:?})" , value, substs) ;
346346 let value = EarlyBinder ( value) . subst ( self . tcx , substs) ;
347- let result = self . normalize_associated_types_in ( span, value) ;
347+ let result = self . normalize ( span, value) ;
348348 debug ! ( "instantiate_type_scheme = {:?}" , result) ;
349349 result
350350 }
@@ -360,19 +360,21 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
360360 let bounds = self . tcx . predicates_of ( def_id) ;
361361 let spans: Vec < Span > = bounds. predicates . iter ( ) . map ( |( _, span) | * span) . collect ( ) ;
362362 let result = bounds. instantiate ( self . tcx , substs) ;
363- let result = self . normalize_associated_types_in ( span, result) ;
363+ let result = self . normalize ( span, result) ;
364364 debug ! (
365365 "instantiate_bounds(bounds={:?}, substs={:?}) = {:?}, {:?}" ,
366366 bounds, substs, result, spans,
367367 ) ;
368368 ( result, spans)
369369 }
370370
371- pub ( in super :: super ) fn normalize_associated_types_in < T > ( & self , span : Span , value : T ) -> T
371+ pub ( in super :: super ) fn normalize < T > ( & self , span : Span , value : T ) -> T
372372 where
373373 T : TypeFoldable < ' tcx > ,
374374 {
375- self . inh . normalize_associated_types_in ( span, self . body_id , self . param_env , value)
375+ self . register_infer_ok_obligations (
376+ self . at ( & self . misc ( span) , self . param_env ) . normalize ( value) ,
377+ )
376378 }
377379
378380 pub ( in super :: super ) fn normalize_associated_types_in_as_infer_ok < T > (
@@ -487,7 +489,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
487489 let span = self . tcx . def_span ( anon_const. def_id ) ;
488490 let c = ty:: Const :: from_anon_const ( self . tcx , anon_const. def_id ) ;
489491 self . register_wf_obligation ( c. into ( ) , span, ObligationCauseCode :: WellFormed ( None ) ) ;
490- self . normalize_associated_types_in ( span, c)
492+ self . normalize ( span, c)
491493 }
492494 }
493495 }
@@ -580,7 +582,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
580582 field : & ' tcx ty:: FieldDef ,
581583 substs : SubstsRef < ' tcx > ,
582584 ) -> Ty < ' tcx > {
583- self . normalize_associated_types_in ( span, field. ty ( self . tcx , substs) )
585+ self . normalize ( span, field. ty ( self . tcx , substs) )
584586 }
585587
586588 pub ( in super :: super ) fn resolve_rvalue_scopes ( & self , def_id : DefId ) {
@@ -1107,7 +1109,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11071109
11081110 if let Res :: Local ( hid) = res {
11091111 let ty = self . local_ty ( span, hid) . decl_ty ;
1110- let ty = self . normalize_associated_types_in ( span, ty) ;
1112+ let ty = self . normalize ( span, ty) ;
11111113 self . write_ty ( hir_id, ty) ;
11121114 return ( ty, res) ;
11131115 }
0 commit comments