@@ -1079,6 +1079,9 @@ pub enum PredicateKind<'tcx> {
1079
1079
1080
1080
/// Constants must be equal. The first component is the const that is expected.
1081
1081
ConstEquate ( & ' tcx Const < ' tcx > , & ' tcx Const < ' tcx > ) ,
1082
+
1083
+ /// Constant must be well formed.
1084
+ WellFormedConst ( & ' tcx Const < ' tcx > ) ,
1082
1085
}
1083
1086
1084
1087
/// The crate outlives map is computed during typeck and contains the
@@ -1195,6 +1198,9 @@ impl<'tcx> Predicate<'tcx> {
1195
1198
PredicateKind :: ConstEquate ( c1, c2) => {
1196
1199
PredicateKind :: ConstEquate ( c1. subst ( tcx, substs) , c2. subst ( tcx, substs) )
1197
1200
}
1201
+ PredicateKind :: WellFormedConst ( c) => {
1202
+ PredicateKind :: WellFormedConst ( c. subst ( tcx, substs) )
1203
+ }
1198
1204
} ;
1199
1205
1200
1206
if new != * kind { new. to_predicate ( tcx) } else { self }
@@ -1386,7 +1392,8 @@ impl<'tcx> Predicate<'tcx> {
1386
1392
| PredicateKind :: ClosureKind ( ..)
1387
1393
| PredicateKind :: TypeOutlives ( ..)
1388
1394
| PredicateKind :: ConstEvaluatable ( ..)
1389
- | PredicateKind :: ConstEquate ( ..) => None ,
1395
+ | PredicateKind :: ConstEquate ( ..)
1396
+ | PredicateKind :: WellFormedConst ( ..) => None ,
1390
1397
}
1391
1398
}
1392
1399
@@ -1401,7 +1408,8 @@ impl<'tcx> Predicate<'tcx> {
1401
1408
| PredicateKind :: ObjectSafe ( ..)
1402
1409
| PredicateKind :: ClosureKind ( ..)
1403
1410
| PredicateKind :: ConstEvaluatable ( ..)
1404
- | PredicateKind :: ConstEquate ( ..) => None ,
1411
+ | PredicateKind :: ConstEquate ( ..)
1412
+ | PredicateKind :: WellFormedConst ( ..) => None ,
1405
1413
}
1406
1414
}
1407
1415
}
0 commit comments