Skip to content

Commit a0ebb2e

Browse files
committed
change map_bound(|_| x to rebind(x
1 parent 8464396 commit a0ebb2e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ impl<'tcx> Predicate<'tcx> {
580580
if let PredicateKind::Trait(TraitPredicate { trait_ref, constness, polarity }) = self.kind().skip_binder()
581581
&& constness != BoundConstness::NotConst
582582
{
583-
self = tcx.mk_predicate(self.kind().map_bound(|_| PredicateKind::Trait(TraitPredicate {
583+
self = tcx.mk_predicate(self.kind().rebind(PredicateKind::Trait(TraitPredicate {
584584
trait_ref,
585585
constness: BoundConstness::NotConst,
586586
polarity,

compiler/rustc_trait_selection/src/traits/relationships.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ pub(crate) fn update<'tcx, T>(
3131
obligation
3232
.predicate
3333
.kind()
34-
.map_bound(|_| {
34+
.rebind(
3535
// (*) binder moved here
3636
ty::PredicateKind::Trait(ty::TraitPredicate {
3737
trait_ref,
3838
constness: tpred.constness,
3939
polarity: tpred.polarity,
4040
})
41-
})
41+
)
4242
.to_predicate(infcx.tcx),
4343
);
4444
// Don't report overflow errors. Otherwise equivalent to may_hold.

compiler/rustc_typeck/src/check/closure.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
182182
ty::PredicateKind::Projection(proj_predicate) => self
183183
.deduce_sig_from_projection(
184184
Some(span.0),
185-
pred.0.kind().rebind(
186-
pred.map_bound(|_| proj_predicate).subst(self.tcx, substs),
187-
),
185+
pred.0
186+
.kind()
187+
.rebind(pred.rebind(proj_predicate).subst(self.tcx, substs)),
188188
),
189189
_ => None,
190190
});

0 commit comments

Comments
 (0)