@@ -552,6 +552,7 @@ impl<'tcx> Predicate<'tcx> {
552
552
| PredicateKind :: Clause ( Clause :: RegionOutlives ( _) )
553
553
| PredicateKind :: Clause ( Clause :: TypeOutlives ( _) )
554
554
| PredicateKind :: Clause ( Clause :: Projection ( _) )
555
+ | PredicateKind :: Clause ( Clause :: ConstArgHasType ( ..) )
555
556
| PredicateKind :: AliasEq ( ..)
556
557
| PredicateKind :: ObjectSafe ( _)
557
558
| PredicateKind :: ClosureKind ( _, _, _)
@@ -590,6 +591,10 @@ pub enum Clause<'tcx> {
590
591
/// `where <T as TraitRef>::Name == X`, approximately.
591
592
/// See the `ProjectionPredicate` struct for details.
592
593
Projection ( ProjectionPredicate < ' tcx > ) ,
594
+
595
+ /// Ensures that a const generic argument to a parameter `const N: u8`
596
+ /// is of type `u8`.
597
+ ConstArgHasType ( Const < ' tcx > , Ty < ' tcx > ) ,
593
598
}
594
599
595
600
#[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
@@ -1193,6 +1198,7 @@ impl<'tcx> Predicate<'tcx> {
1193
1198
match predicate. skip_binder ( ) {
1194
1199
PredicateKind :: Clause ( Clause :: Trait ( t) ) => Some ( predicate. rebind ( t) ) ,
1195
1200
PredicateKind :: Clause ( Clause :: Projection ( ..) )
1201
+ | PredicateKind :: Clause ( Clause :: ConstArgHasType ( ..) )
1196
1202
| PredicateKind :: AliasEq ( ..)
1197
1203
| PredicateKind :: Subtype ( ..)
1198
1204
| PredicateKind :: Coerce ( ..)
@@ -1213,6 +1219,7 @@ impl<'tcx> Predicate<'tcx> {
1213
1219
match predicate. skip_binder ( ) {
1214
1220
PredicateKind :: Clause ( Clause :: Projection ( t) ) => Some ( predicate. rebind ( t) ) ,
1215
1221
PredicateKind :: Clause ( Clause :: Trait ( ..) )
1222
+ | PredicateKind :: Clause ( Clause :: ConstArgHasType ( ..) )
1216
1223
| PredicateKind :: AliasEq ( ..)
1217
1224
| PredicateKind :: Subtype ( ..)
1218
1225
| PredicateKind :: Coerce ( ..)
@@ -1233,6 +1240,7 @@ impl<'tcx> Predicate<'tcx> {
1233
1240
match predicate. skip_binder ( ) {
1234
1241
PredicateKind :: Clause ( Clause :: TypeOutlives ( data) ) => Some ( predicate. rebind ( data) ) ,
1235
1242
PredicateKind :: Clause ( Clause :: Trait ( ..) )
1243
+ | PredicateKind :: Clause ( Clause :: ConstArgHasType ( ..) )
1236
1244
| PredicateKind :: Clause ( Clause :: Projection ( ..) )
1237
1245
| PredicateKind :: AliasEq ( ..)
1238
1246
| PredicateKind :: Subtype ( ..)
0 commit comments