@@ -555,7 +555,7 @@ impl<'tcx> Predicate<'tcx> {
555555 | PredicateKind :: Clause ( ClauseKind :: ConstEvaluatable ( _) )
556556 | PredicateKind :: ConstEquate ( _, _)
557557 | PredicateKind :: Ambiguous
558- | PredicateKind :: TypeWellFormedFromEnv ( _) => true ,
558+ | PredicateKind :: Clause ( ClauseKind :: TypeWellFormedFromEnv ( _) ) => true ,
559559 }
560560 }
561561}
@@ -661,6 +661,11 @@ pub enum ClauseKind<'tcx> {
661661
662662 /// Constant initializer must evaluate successfully.
663663 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 > ) ,
664669}
665670
666671#[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
@@ -697,11 +702,6 @@ pub enum PredicateKind<'tcx> {
697702 /// Constants must be equal. The first component is the const that is expected.
698703 ConstEquate ( Const < ' tcx > , Const < ' tcx > ) ,
699704
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-
705705 /// A marker predicate that is always ambiguous.
706706 /// Used for coherence to mark opaque types as possibly equal to each other but ambiguous.
707707 Ambiguous ,
@@ -1425,7 +1425,7 @@ impl<'tcx> Predicate<'tcx> {
14251425 | PredicateKind :: Clause ( ClauseKind :: ConstEvaluatable ( ..) )
14261426 | PredicateKind :: ConstEquate ( ..)
14271427 | PredicateKind :: Ambiguous
1428- | PredicateKind :: TypeWellFormedFromEnv ( ..) => None ,
1428+ | PredicateKind :: Clause ( ClauseKind :: TypeWellFormedFromEnv ( ..) ) => None ,
14291429 }
14301430 }
14311431
@@ -1446,7 +1446,7 @@ impl<'tcx> Predicate<'tcx> {
14461446 | PredicateKind :: Clause ( ClauseKind :: ConstEvaluatable ( ..) )
14471447 | PredicateKind :: ConstEquate ( ..)
14481448 | PredicateKind :: Ambiguous
1449- | PredicateKind :: TypeWellFormedFromEnv ( ..) => None ,
1449+ | PredicateKind :: Clause ( ClauseKind :: TypeWellFormedFromEnv ( ..) ) => None ,
14501450 }
14511451 }
14521452
@@ -1467,7 +1467,7 @@ impl<'tcx> Predicate<'tcx> {
14671467 | PredicateKind :: Clause ( ClauseKind :: ConstEvaluatable ( ..) )
14681468 | PredicateKind :: ConstEquate ( ..)
14691469 | PredicateKind :: Ambiguous
1470- | PredicateKind :: TypeWellFormedFromEnv ( ..) => None ,
1470+ | PredicateKind :: Clause ( ClauseKind :: TypeWellFormedFromEnv ( ..) ) => None ,
14711471 }
14721472 }
14731473
@@ -1483,7 +1483,7 @@ impl<'tcx> Predicate<'tcx> {
14831483 pub fn expect_clause ( self ) -> Clause < ' tcx > {
14841484 match self . kind ( ) . skip_binder ( ) {
14851485 PredicateKind :: Clause ( ..) => Clause ( self . 0 ) ,
1486- _ => bug ! ( ) ,
1486+ _ => bug ! ( "{self} is not a clause" ) ,
14871487 }
14881488 }
14891489}
0 commit comments