@@ -258,7 +258,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
258
258
let bound_predicate = obligation. predicate . bound_atom ( self . tcx ) ;
259
259
match bound_predicate. skip_binder ( ) {
260
260
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) ;
262
262
let trait_predicate = self . resolve_vars_if_possible ( & trait_predicate) ;
263
263
264
264
if self . tcx . sess . has_errors ( ) && trait_predicate. references_error ( ) {
@@ -532,7 +532,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
532
532
}
533
533
534
534
ty:: PredicateAtom :: RegionOutlives ( predicate) => {
535
- let predicate = bound_predicate. map_bound_ref ( |_| predicate) ;
535
+ let predicate = bound_predicate. rebind ( predicate) ;
536
536
let predicate = self . resolve_vars_if_possible ( & predicate) ;
537
537
let err = self
538
538
. region_outlives_predicate ( & obligation. cause , predicate)
@@ -1082,7 +1082,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1082
1082
let bound_error = error. bound_atom ( self . tcx ) ;
1083
1083
let ( cond, error) = match ( cond. skip_binders ( ) , bound_error. skip_binder ( ) ) {
1084
1084
( ty:: PredicateAtom :: Trait ( ..) , ty:: PredicateAtom :: Trait ( error, _) ) => {
1085
- ( cond, bound_error. map_bound_ref ( |_| error) )
1085
+ ( cond, bound_error. rebind ( error) )
1086
1086
}
1087
1087
_ => {
1088
1088
// FIXME: make this work in other cases too.
@@ -1094,7 +1094,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1094
1094
let bound_predicate = obligation. predicate . bound_atom ( self . tcx ) ;
1095
1095
if let ty:: PredicateAtom :: Trait ( implication, _) = bound_predicate. skip_binder ( ) {
1096
1096
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 ) ;
1098
1098
// FIXME: I'm just not taking associated types at all here.
1099
1099
// Eventually I'll need to implement param-env-aware
1100
1100
// `Γ₁ ⊦ φ₁ => Γ₂ ⊦ φ₂` logic.
@@ -1178,7 +1178,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1178
1178
let ( data, _) = self . replace_bound_vars_with_fresh_vars (
1179
1179
obligation. cause . span ,
1180
1180
infer:: LateBoundRegionConversionTime :: HigherRankedType ,
1181
- & bound_predicate. map_bound_ref ( |_| data) ,
1181
+ & bound_predicate. rebind ( data) ,
1182
1182
) ;
1183
1183
let mut obligations = vec ! [ ] ;
1184
1184
let normalized_ty = super :: normalize_projection_type (
@@ -1463,7 +1463,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1463
1463
let mut err = match bound_predicate. skip_binder ( ) {
1464
1464
ty:: PredicateAtom :: Trait ( data, _) => {
1465
1465
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 ) ;
1467
1467
debug ! ( "self_ty {:?} {:?} trait_ref {:?}" , self_ty, self_ty. kind( ) , trait_ref) ;
1468
1468
1469
1469
if predicate. references_error ( ) {
@@ -1587,7 +1587,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
1587
1587
self . emit_inference_failure_err ( body_id, span, a. into ( ) , ErrorCode :: E0282 )
1588
1588
}
1589
1589
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 ) ;
1591
1591
let self_ty = trait_ref. skip_binder ( ) . self_ty ( ) ;
1592
1592
let ty = data. ty ;
1593
1593
if predicate. references_error ( ) {
0 commit comments