Skip to content

Commit

Permalink
change map_bound(|_| x to rebind(x
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Jul 21, 2022
1 parent 8464396 commit a0ebb2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ impl<'tcx> Predicate<'tcx> {
if let PredicateKind::Trait(TraitPredicate { trait_ref, constness, polarity }) = self.kind().skip_binder()
&& constness != BoundConstness::NotConst
{
self = tcx.mk_predicate(self.kind().map_bound(|_| PredicateKind::Trait(TraitPredicate {
self = tcx.mk_predicate(self.kind().rebind(PredicateKind::Trait(TraitPredicate {
trait_ref,
constness: BoundConstness::NotConst,
polarity,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_trait_selection/src/traits/relationships.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ pub(crate) fn update<'tcx, T>(
obligation
.predicate
.kind()
.map_bound(|_| {
.rebind(
// (*) binder moved here
ty::PredicateKind::Trait(ty::TraitPredicate {
trait_ref,
constness: tpred.constness,
polarity: tpred.polarity,
})
})
)
.to_predicate(infcx.tcx),
);
// Don't report overflow errors. Otherwise equivalent to may_hold.
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_typeck/src/check/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
ty::PredicateKind::Projection(proj_predicate) => self
.deduce_sig_from_projection(
Some(span.0),
pred.0.kind().rebind(
pred.map_bound(|_| proj_predicate).subst(self.tcx, substs),
),
pred.0
.kind()
.rebind(pred.rebind(proj_predicate).subst(self.tcx, substs)),
),
_ => None,
});
Expand Down

0 comments on commit a0ebb2e

Please sign in to comment.