@@ -552,6 +552,7 @@ impl<'tcx> Predicate<'tcx> {
552552 | PredicateKind :: Clause ( Clause :: RegionOutlives ( _) )
553553 | PredicateKind :: Clause ( Clause :: TypeOutlives ( _) )
554554 | PredicateKind :: Clause ( Clause :: Projection ( _) )
555+ | PredicateKind :: Clause ( Clause :: ConstArgHasType ( ..) )
555556 | PredicateKind :: AliasEq ( ..)
556557 | PredicateKind :: ObjectSafe ( _)
557558 | PredicateKind :: ClosureKind ( _, _, _)
@@ -590,6 +591,10 @@ pub enum Clause<'tcx> {
590591 /// `where <T as TraitRef>::Name == X`, approximately.
591592 /// See the `ProjectionPredicate` struct for details.
592593 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 > ) ,
593598}
594599
595600#[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
@@ -1193,6 +1198,7 @@ impl<'tcx> Predicate<'tcx> {
11931198 match predicate. skip_binder ( ) {
11941199 PredicateKind :: Clause ( Clause :: Trait ( t) ) => Some ( predicate. rebind ( t) ) ,
11951200 PredicateKind :: Clause ( Clause :: Projection ( ..) )
1201+ | PredicateKind :: Clause ( Clause :: ConstArgHasType ( ..) )
11961202 | PredicateKind :: AliasEq ( ..)
11971203 | PredicateKind :: Subtype ( ..)
11981204 | PredicateKind :: Coerce ( ..)
@@ -1213,6 +1219,7 @@ impl<'tcx> Predicate<'tcx> {
12131219 match predicate. skip_binder ( ) {
12141220 PredicateKind :: Clause ( Clause :: Projection ( t) ) => Some ( predicate. rebind ( t) ) ,
12151221 PredicateKind :: Clause ( Clause :: Trait ( ..) )
1222+ | PredicateKind :: Clause ( Clause :: ConstArgHasType ( ..) )
12161223 | PredicateKind :: AliasEq ( ..)
12171224 | PredicateKind :: Subtype ( ..)
12181225 | PredicateKind :: Coerce ( ..)
@@ -1233,6 +1240,7 @@ impl<'tcx> Predicate<'tcx> {
12331240 match predicate. skip_binder ( ) {
12341241 PredicateKind :: Clause ( Clause :: TypeOutlives ( data) ) => Some ( predicate. rebind ( data) ) ,
12351242 PredicateKind :: Clause ( Clause :: Trait ( ..) )
1243+ | PredicateKind :: Clause ( Clause :: ConstArgHasType ( ..) )
12361244 | PredicateKind :: Clause ( Clause :: Projection ( ..) )
12371245 | PredicateKind :: AliasEq ( ..)
12381246 | PredicateKind :: Subtype ( ..)
0 commit comments