Skip to content

Commit 1c75724

Browse files
committed
Properly compare previously shadowed values
The shadowing lead to an incorrect comparison. Rename it and compare it properly. compiler-errors told me that I should just include the fix here without a test.
1 parent 07cd382 commit 1c75724

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_hir_typeck/src/_match.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
538538
// FIXME(rpitit): This will need to be fixed when we move to associated types
539539
assert!(matches!(
540540
*trait_pred.trait_ref.self_ty().kind(),
541-
ty::Alias(_, ty::AliasTy { def_id, substs, .. })
542-
if def_id == rpit_def_id && substs == substs
541+
ty::Alias(_, ty::AliasTy { def_id, substs: alias_substs, .. })
542+
if def_id == rpit_def_id && substs == alias_substs
543543
));
544544
ty::PredicateKind::Clause(ty::Clause::Trait(
545545
trait_pred.with_self_ty(self.tcx, ty),
@@ -548,8 +548,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
548548
ty::PredicateKind::Clause(ty::Clause::Projection(mut proj_pred)) => {
549549
assert!(matches!(
550550
*proj_pred.projection_ty.self_ty().kind(),
551-
ty::Alias(_, ty::AliasTy { def_id, substs, .. })
552-
if def_id == rpit_def_id && substs == substs
551+
ty::Alias(_, ty::AliasTy { def_id, substs: alias_substs, .. })
552+
if def_id == rpit_def_id && substs == alias_substs
553553
));
554554
proj_pred = proj_pred.with_self_ty(self.tcx, ty);
555555
ty::PredicateKind::Clause(ty::Clause::Projection(proj_pred))

0 commit comments

Comments
 (0)