@@ -97,12 +97,12 @@ pub use self::rvalue_scopes::RvalueScopes;
9797pub use self :: sty:: BoundRegionKind :: * ;
9898pub use self :: sty:: {
9999 AliasTy , Article , Binder , BoundRegion , BoundRegionKind , BoundTy , BoundTyKind , BoundVar ,
100- BoundVariableKind , CanonicalPolyFnSig , ClosureArgs , ClosureArgsParts , ConstKind , ConstVid ,
101- CoroutineArgs , CoroutineArgsParts , EarlyBoundRegion , EffectVid , ExistentialPredicate ,
100+ BoundVariableKind , CanonicalPolyFnSig , ClauseKind , ClosureArgs , ClosureArgsParts , ConstKind ,
101+ ConstVid , CoroutineArgs , CoroutineArgsParts , EarlyBoundRegion , EffectVid , ExistentialPredicate ,
102102 ExistentialProjection , ExistentialTraitRef , FnSig , FreeRegion , GenSig , InlineConstArgs ,
103103 InlineConstArgsParts , ParamConst , ParamTy , PolyExistentialPredicate , PolyExistentialProjection ,
104- PolyExistentialTraitRef , PolyFnSig , PolyGenSig , PolyTraitRef , Region , RegionKind , RegionVid ,
105- TraitRef , TyKind , TypeAndMut , UpvarArgs , VarianceDiagInfo ,
104+ PolyExistentialTraitRef , PolyFnSig , PolyGenSig , PolyTraitRef , PredicateKind , Region ,
105+ RegionKind , RegionVid , TraitRef , TyKind , TypeAndMut , UpvarArgs , VarianceDiagInfo ,
106106} ;
107107pub use self :: trait_def:: TraitDef ;
108108pub use self :: typeck_results:: {
@@ -626,98 +626,6 @@ impl<'tcx> Clause<'tcx> {
626626 }
627627}
628628
629- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
630- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
631- /// A clause is something that can appear in where bounds or be inferred
632- /// by implied bounds.
633- pub enum ClauseKind < ' tcx > {
634- /// Corresponds to `where Foo: Bar<A, B, C>`. `Foo` here would be
635- /// the `Self` type of the trait reference and `A`, `B`, and `C`
636- /// would be the type parameters.
637- Trait ( TraitPredicate < ' tcx > ) ,
638-
639- /// `where 'a: 'b`
640- RegionOutlives ( RegionOutlivesPredicate < ' tcx > ) ,
641-
642- /// `where T: 'a`
643- TypeOutlives ( TypeOutlivesPredicate < ' tcx > ) ,
644-
645- /// `where <T as TraitRef>::Name == X`, approximately.
646- /// See the `ProjectionPredicate` struct for details.
647- Projection ( ProjectionPredicate < ' tcx > ) ,
648-
649- /// Ensures that a const generic argument to a parameter `const N: u8`
650- /// is of type `u8`.
651- ConstArgHasType ( Const < ' tcx > , Ty < ' tcx > ) ,
652-
653- /// No syntax: `T` well-formed.
654- WellFormed ( GenericArg < ' tcx > ) ,
655-
656- /// Constant initializer must evaluate successfully.
657- ConstEvaluatable ( ty:: Const < ' tcx > ) ,
658- }
659-
660- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
661- #[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
662- pub enum PredicateKind < ' tcx > {
663- /// Prove a clause
664- Clause ( ClauseKind < ' tcx > ) ,
665-
666- /// Trait must be object-safe.
667- ObjectSafe ( DefId ) ,
668-
669- /// No direct syntax. May be thought of as `where T: FnFoo<...>`
670- /// for some generic args `...` and `T` being a closure type.
671- /// Satisfied (or refuted) once we know the closure's kind.
672- ClosureKind ( DefId , GenericArgsRef < ' tcx > , ClosureKind ) ,
673-
674- /// `T1 <: T2`
675- ///
676- /// This obligation is created most often when we have two
677- /// unresolved type variables and hence don't have enough
678- /// information to process the subtyping obligation yet.
679- Subtype ( SubtypePredicate < ' tcx > ) ,
680-
681- /// `T1` coerced to `T2`
682- ///
683- /// Like a subtyping obligation, this is created most often
684- /// when we have two unresolved type variables and hence
685- /// don't have enough information to process the coercion
686- /// obligation yet. At the moment, we actually process coercions
687- /// very much like subtyping and don't handle the full coercion
688- /// logic.
689- Coerce ( CoercePredicate < ' tcx > ) ,
690-
691- /// Constants must be equal. The first component is the const that is expected.
692- ConstEquate ( Const < ' tcx > , Const < ' tcx > ) ,
693-
694- /// A marker predicate that is always ambiguous.
695- /// Used for coherence to mark opaque types as possibly equal to each other but ambiguous.
696- Ambiguous ,
697-
698- /// Separate from `ClauseKind::Projection` which is used for normalization in new solver.
699- /// This predicate requires two terms to be equal to eachother.
700- ///
701- /// Only used for new solver
702- AliasRelate ( Term < ' tcx > , Term < ' tcx > , AliasRelationDirection ) ,
703- }
704-
705- #[ derive( Clone , Copy , PartialEq , Eq , Hash , TyEncodable , TyDecodable ) ]
706- #[ derive( HashStable , Debug ) ]
707- pub enum AliasRelationDirection {
708- Equate ,
709- Subtype ,
710- }
711-
712- impl std:: fmt:: Display for AliasRelationDirection {
713- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
714- match self {
715- AliasRelationDirection :: Equate => write ! ( f, "==" ) ,
716- AliasRelationDirection :: Subtype => write ! ( f, "<:" ) ,
717- }
718- }
719- }
720-
721629/// The crate outlives map is computed during typeck and contains the
722630/// outlives of every item in the local crate. You should not use it
723631/// directly, because to do so will make your pass dependent on the
0 commit comments