File tree 1 file changed +8
-2
lines changed
compiler/rustc_middle/src/ty
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -435,7 +435,10 @@ pub fn structurally_relate_tys<'tcx, R: TypeRelation<'tcx>>(
435
435
Ok ( a)
436
436
}
437
437
438
- ( ty:: Param ( a_p) , ty:: Param ( b_p) ) if a_p. index == b_p. index => Ok ( a) ,
438
+ ( ty:: Param ( a_p) , ty:: Param ( b_p) ) if a_p. index == b_p. index => {
439
+ debug_assert_eq ! ( a_p. name, b_p. name, "param types with same index differ in name" ) ;
440
+ Ok ( a)
441
+ } ,
439
442
440
443
( ty:: Placeholder ( p1) , ty:: Placeholder ( p2) ) if p1 == p2 => Ok ( a) ,
441
444
@@ -586,7 +589,10 @@ pub fn structurally_relate_consts<'tcx, R: TypeRelation<'tcx>>(
586
589
( ty:: ConstKind :: Error ( _) , _) => return Ok ( a) ,
587
590
( _, ty:: ConstKind :: Error ( _) ) => return Ok ( b) ,
588
591
589
- ( ty:: ConstKind :: Param ( a_p) , ty:: ConstKind :: Param ( b_p) ) => a_p. index == b_p. index ,
592
+ ( ty:: ConstKind :: Param ( a_p) , ty:: ConstKind :: Param ( b_p) ) if a_p. index == b_p. index => {
593
+ debug_assert_eq ! ( a_p. name, b_p. name, "param types with same index differ in name" ) ;
594
+ true
595
+ }
590
596
( ty:: ConstKind :: Placeholder ( p1) , ty:: ConstKind :: Placeholder ( p2) ) => p1 == p2,
591
597
( ty:: ConstKind :: Value ( a_val) , ty:: ConstKind :: Value ( b_val) ) => a_val == b_val,
592
598
You can’t perform that action at this time.
0 commit comments