@@ -555,7 +555,7 @@ impl<'tcx> Predicate<'tcx> {
555
555
| PredicateKind :: Clause ( ClauseKind :: ConstEvaluatable ( _) )
556
556
| PredicateKind :: ConstEquate ( _, _)
557
557
| PredicateKind :: Ambiguous
558
- | PredicateKind :: TypeWellFormedFromEnv ( _) => true ,
558
+ | PredicateKind :: Clause ( ClauseKind :: TypeWellFormedFromEnv ( _) ) => true ,
559
559
}
560
560
}
561
561
}
@@ -661,6 +661,11 @@ pub enum ClauseKind<'tcx> {
661
661
662
662
/// Constant initializer must evaluate successfully.
663
663
ConstEvaluatable ( ty:: Const < ' tcx > ) ,
664
+
665
+ /// Represents a type found in the environment that we can use for implied bounds.
666
+ ///
667
+ /// Only used for Chalk.
668
+ TypeWellFormedFromEnv ( Ty < ' tcx > ) ,
664
669
}
665
670
666
671
#[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
@@ -697,11 +702,6 @@ pub enum PredicateKind<'tcx> {
697
702
/// Constants must be equal. The first component is the const that is expected.
698
703
ConstEquate ( Const < ' tcx > , Const < ' tcx > ) ,
699
704
700
- /// Represents a type found in the environment that we can use for implied bounds.
701
- ///
702
- /// Only used for Chalk.
703
- TypeWellFormedFromEnv ( Ty < ' tcx > ) ,
704
-
705
705
/// A marker predicate that is always ambiguous.
706
706
/// Used for coherence to mark opaque types as possibly equal to each other but ambiguous.
707
707
Ambiguous ,
@@ -1425,7 +1425,7 @@ impl<'tcx> Predicate<'tcx> {
1425
1425
| PredicateKind :: Clause ( ClauseKind :: ConstEvaluatable ( ..) )
1426
1426
| PredicateKind :: ConstEquate ( ..)
1427
1427
| PredicateKind :: Ambiguous
1428
- | PredicateKind :: TypeWellFormedFromEnv ( ..) => None ,
1428
+ | PredicateKind :: Clause ( ClauseKind :: TypeWellFormedFromEnv ( ..) ) => None ,
1429
1429
}
1430
1430
}
1431
1431
@@ -1446,7 +1446,7 @@ impl<'tcx> Predicate<'tcx> {
1446
1446
| PredicateKind :: Clause ( ClauseKind :: ConstEvaluatable ( ..) )
1447
1447
| PredicateKind :: ConstEquate ( ..)
1448
1448
| PredicateKind :: Ambiguous
1449
- | PredicateKind :: TypeWellFormedFromEnv ( ..) => None ,
1449
+ | PredicateKind :: Clause ( ClauseKind :: TypeWellFormedFromEnv ( ..) ) => None ,
1450
1450
}
1451
1451
}
1452
1452
@@ -1467,7 +1467,7 @@ impl<'tcx> Predicate<'tcx> {
1467
1467
| PredicateKind :: Clause ( ClauseKind :: ConstEvaluatable ( ..) )
1468
1468
| PredicateKind :: ConstEquate ( ..)
1469
1469
| PredicateKind :: Ambiguous
1470
- | PredicateKind :: TypeWellFormedFromEnv ( ..) => None ,
1470
+ | PredicateKind :: Clause ( ClauseKind :: TypeWellFormedFromEnv ( ..) ) => None ,
1471
1471
}
1472
1472
}
1473
1473
@@ -1483,7 +1483,7 @@ impl<'tcx> Predicate<'tcx> {
1483
1483
pub fn expect_clause ( self ) -> Clause < ' tcx > {
1484
1484
match self . kind ( ) . skip_binder ( ) {
1485
1485
PredicateKind :: Clause ( ..) => Clause ( self . 0 ) ,
1486
- _ => bug ! ( ) ,
1486
+ _ => bug ! ( "{self} is not a clause" ) ,
1487
1487
}
1488
1488
}
1489
1489
}
0 commit comments