@@ -1079,6 +1079,9 @@ pub enum PredicateKind<'tcx> {
10791079
10801080 /// Constants must be equal. The first component is the const that is expected.
10811081 ConstEquate ( & ' tcx Const < ' tcx > , & ' tcx Const < ' tcx > ) ,
1082+
1083+ /// Constant must be well formed.
1084+ WellFormedConst ( & ' tcx Const < ' tcx > ) ,
10821085}
10831086
10841087/// The crate outlives map is computed during typeck and contains the
@@ -1195,6 +1198,9 @@ impl<'tcx> Predicate<'tcx> {
11951198 PredicateKind :: ConstEquate ( c1, c2) => {
11961199 PredicateKind :: ConstEquate ( c1. subst ( tcx, substs) , c2. subst ( tcx, substs) )
11971200 }
1201+ PredicateKind :: WellFormedConst ( c) => {
1202+ PredicateKind :: WellFormedConst ( c. subst ( tcx, substs) )
1203+ }
11981204 } ;
11991205
12001206 if new != * kind { new. to_predicate ( tcx) } else { self }
@@ -1386,7 +1392,8 @@ impl<'tcx> Predicate<'tcx> {
13861392 | PredicateKind :: ClosureKind ( ..)
13871393 | PredicateKind :: TypeOutlives ( ..)
13881394 | PredicateKind :: ConstEvaluatable ( ..)
1389- | PredicateKind :: ConstEquate ( ..) => None ,
1395+ | PredicateKind :: ConstEquate ( ..)
1396+ | PredicateKind :: WellFormedConst ( ..) => None ,
13901397 }
13911398 }
13921399
@@ -1401,7 +1408,8 @@ impl<'tcx> Predicate<'tcx> {
14011408 | PredicateKind :: ObjectSafe ( ..)
14021409 | PredicateKind :: ClosureKind ( ..)
14031410 | PredicateKind :: ConstEvaluatable ( ..)
1404- | PredicateKind :: ConstEquate ( ..) => None ,
1411+ | PredicateKind :: ConstEquate ( ..)
1412+ | PredicateKind :: WellFormedConst ( ..) => None ,
14051413 }
14061414 }
14071415}
0 commit comments