@@ -258,7 +258,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
258258 let bound_predicate = obligation. predicate . bound_atom ( self . tcx ) ;
259259 match bound_predicate. skip_binder ( ) {
260260 ty:: PredicateAtom :: Trait ( trait_predicate, _) => {
261- let trait_predicate = bound_predicate. map_bound_ref ( |_| trait_predicate) ;
261+ let trait_predicate = bound_predicate. rebind ( trait_predicate) ;
262262 let trait_predicate = self . resolve_vars_if_possible ( & trait_predicate) ;
263263
264264 if self . tcx . sess . has_errors ( ) && trait_predicate. references_error ( ) {
@@ -532,7 +532,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
532532 }
533533
534534 ty:: PredicateAtom :: RegionOutlives ( predicate) => {
535- let predicate = bound_predicate. map_bound_ref ( |_| predicate) ;
535+ let predicate = bound_predicate. rebind ( predicate) ;
536536 let predicate = self . resolve_vars_if_possible ( & predicate) ;
537537 let err = self
538538 . region_outlives_predicate ( & obligation. cause , predicate)
@@ -1082,7 +1082,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
10821082 let bound_error = error. bound_atom ( self . tcx ) ;
10831083 let ( cond, error) = match ( cond. skip_binders ( ) , bound_error. skip_binder ( ) ) {
10841084 ( ty:: PredicateAtom :: Trait ( ..) , ty:: PredicateAtom :: Trait ( error, _) ) => {
1085- ( cond, bound_error. map_bound_ref ( |_| error) )
1085+ ( cond, bound_error. rebind ( error) )
10861086 }
10871087 _ => {
10881088 // FIXME: make this work in other cases too.
@@ -1094,7 +1094,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
10941094 let bound_predicate = obligation. predicate . bound_atom ( self . tcx ) ;
10951095 if let ty:: PredicateAtom :: Trait ( implication, _) = bound_predicate. skip_binder ( ) {
10961096 let error = error. to_poly_trait_ref ( ) ;
1097- let implication = bound_predicate. map_bound_ref ( |_| implication. trait_ref ) ;
1097+ let implication = bound_predicate. rebind ( implication. trait_ref ) ;
10981098 // FIXME: I'm just not taking associated types at all here.
10991099 // Eventually I'll need to implement param-env-aware
11001100 // `Γ₁ ⊦ φ₁ => Γ₂ ⊦ φ₂` logic.
@@ -1178,7 +1178,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
11781178 let ( data, _) = self . replace_bound_vars_with_fresh_vars (
11791179 obligation. cause . span ,
11801180 infer:: LateBoundRegionConversionTime :: HigherRankedType ,
1181- & bound_predicate. map_bound_ref ( |_| data) ,
1181+ & bound_predicate. rebind ( data) ,
11821182 ) ;
11831183 let mut obligations = vec ! [ ] ;
11841184 let normalized_ty = super :: normalize_projection_type (
@@ -1463,7 +1463,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
14631463 let mut err = match bound_predicate. skip_binder ( ) {
14641464 ty:: PredicateAtom :: Trait ( data, _) => {
14651465 let self_ty = data. trait_ref . self_ty ( ) ;
1466- let trait_ref = bound_predicate. map_bound_ref ( |_| data. trait_ref ) ;
1466+ let trait_ref = bound_predicate. rebind ( data. trait_ref ) ;
14671467 debug ! ( "self_ty {:?} {:?} trait_ref {:?}" , self_ty, self_ty. kind( ) , trait_ref) ;
14681468
14691469 if predicate. references_error ( ) {
@@ -1587,7 +1587,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
15871587 self . emit_inference_failure_err ( body_id, span, a. into ( ) , ErrorCode :: E0282 )
15881588 }
15891589 ty:: PredicateAtom :: Projection ( data) => {
1590- let trait_ref = bound_predicate. map_bound_ref ( |_| data) . to_poly_trait_ref ( self . tcx ) ;
1590+ let trait_ref = bound_predicate. rebind ( data) . to_poly_trait_ref ( self . tcx ) ;
15911591 let self_ty = trait_ref. skip_binder ( ) . self_ty ( ) ;
15921592 let ty = data. ty ;
15931593 if predicate. references_error ( ) {
0 commit comments