@@ -344,7 +344,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
344
344
{
345
345
debug ! ( "instantiate_type_scheme(value={:?}, substs={:?})" , value, substs) ;
346
346
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) ;
348
348
debug ! ( "instantiate_type_scheme = {:?}" , result) ;
349
349
result
350
350
}
@@ -360,19 +360,21 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
360
360
let bounds = self . tcx . predicates_of ( def_id) ;
361
361
let spans: Vec < Span > = bounds. predicates . iter ( ) . map ( |( _, span) | * span) . collect ( ) ;
362
362
let result = bounds. instantiate ( self . tcx , substs) ;
363
- let result = self . normalize_associated_types_in ( span, result) ;
363
+ let result = self . normalize ( span, result) ;
364
364
debug ! (
365
365
"instantiate_bounds(bounds={:?}, substs={:?}) = {:?}, {:?}" ,
366
366
bounds, substs, result, spans,
367
367
) ;
368
368
( result, spans)
369
369
}
370
370
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
372
372
where
373
373
T : TypeFoldable < ' tcx > ,
374
374
{
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
+ )
376
378
}
377
379
378
380
pub ( in super :: super ) fn normalize_associated_types_in_as_infer_ok < T > (
@@ -487,7 +489,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
487
489
let span = self . tcx . def_span ( anon_const. def_id ) ;
488
490
let c = ty:: Const :: from_anon_const ( self . tcx , anon_const. def_id ) ;
489
491
self . register_wf_obligation ( c. into ( ) , span, ObligationCauseCode :: WellFormed ( None ) ) ;
490
- self . normalize_associated_types_in ( span, c)
492
+ self . normalize ( span, c)
491
493
}
492
494
}
493
495
}
@@ -580,7 +582,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
580
582
field : & ' tcx ty:: FieldDef ,
581
583
substs : SubstsRef < ' tcx > ,
582
584
) -> Ty < ' tcx > {
583
- self . normalize_associated_types_in ( span, field. ty ( self . tcx , substs) )
585
+ self . normalize ( span, field. ty ( self . tcx , substs) )
584
586
}
585
587
586
588
pub ( in super :: super ) fn resolve_rvalue_scopes ( & self , def_id : DefId ) {
@@ -1107,7 +1109,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1107
1109
1108
1110
if let Res :: Local ( hid) = res {
1109
1111
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) ;
1111
1113
self . write_ty ( hir_id, ty) ;
1112
1114
return ( ty, res) ;
1113
1115
}
0 commit comments