@@ -330,7 +330,14 @@ impl<I: Interner> PartialEq for TyKind<I> {
330
330
( Placeholder ( a_p) , Placeholder ( b_p) ) => a_p == b_p,
331
331
( Infer ( a_t) , Infer ( b_t) ) => a_t == b_t,
332
332
( Error ( a_e) , Error ( b_e) ) => a_e == b_e,
333
- _ => true , // unreachable
333
+ ( Bool , Bool ) | ( Char , Char ) | ( Str , Str ) | ( Never , Never ) => true ,
334
+ _ => {
335
+ debug_assert ! (
336
+ false ,
337
+ "This branch must be unreachable, maybe the match is missing an arm? self = self = {self:?}, other = {other:?}"
338
+ ) ;
339
+ true
340
+ }
334
341
}
335
342
}
336
343
}
@@ -381,7 +388,11 @@ impl<I: Interner> Ord for TyKind<I> {
381
388
( Placeholder ( a_p) , Placeholder ( b_p) ) => a_p. cmp ( b_p) ,
382
389
( Infer ( a_t) , Infer ( b_t) ) => a_t. cmp ( b_t) ,
383
390
( Error ( a_e) , Error ( b_e) ) => a_e. cmp ( b_e) ,
384
- _ => Ordering :: Equal , // unreachable
391
+ ( Bool , Bool ) | ( Char , Char ) | ( Str , Str ) | ( Never , Never ) => Ordering :: Equal ,
392
+ _ => {
393
+ debug_assert ! ( false , "This branch must be unreachable, maybe the match is missing an arm? self = self = {self:?}, other = {other:?}" ) ;
394
+ Ordering :: Equal
395
+ }
385
396
}
386
397
} )
387
398
}
@@ -977,7 +988,13 @@ impl<I: Interner> PartialEq for RegionKind<I> {
977
988
( ReVar ( a_r) , ReVar ( b_r) ) => a_r == b_r,
978
989
( RePlaceholder ( a_r) , RePlaceholder ( b_r) ) => a_r == b_r,
979
990
( ReErased , ReErased ) => true ,
980
- _ => true , // unreachable
991
+ _ => {
992
+ debug_assert ! (
993
+ false ,
994
+ "This branch must be unreachable, maybe the match is missing an arm? self = self = {self:?}, other = {other:?}"
995
+ ) ;
996
+ true
997
+ }
981
998
}
982
999
}
983
1000
}
@@ -1008,7 +1025,10 @@ impl<I: Interner> Ord for RegionKind<I> {
1008
1025
( ReVar ( a_r) , ReVar ( b_r) ) => a_r. cmp ( b_r) ,
1009
1026
( RePlaceholder ( a_r) , RePlaceholder ( b_r) ) => a_r. cmp ( b_r) ,
1010
1027
( ReErased , ReErased ) => Ordering :: Equal ,
1011
- _ => Ordering :: Equal , // unreachable
1028
+ _ => {
1029
+ debug_assert ! ( false , "This branch must be unreachable, maybe the match is missing an arm? self = self = {self:?}, other = {other:?}" ) ;
1030
+ Ordering :: Equal
1031
+ }
1012
1032
}
1013
1033
} )
1014
1034
}
0 commit comments