Enum rustc_middle::ty::PredicateKind[][src]

pub enum PredicateKind<'tcx> {
    Trait(TraitPredicate<'tcx>, Constness),
    RegionOutlives(RegionOutlivesPredicate<'tcx>),
    TypeOutlives(TypeOutlivesPredicate<'tcx>),
    Projection(ProjectionPredicate<'tcx>),
    WellFormed(GenericArg<'tcx>),
    ObjectSafe(DefId),
    ClosureKind(DefIdSubstsRef<'tcx>, ClosureKind),
    Subtype(SubtypePredicate<'tcx>),
    ConstEvaluatable(WithOptConstParam<DefId>, SubstsRef<'tcx>),
    ConstEquate(&'tcx Const<'tcx>, &'tcx Const<'tcx>),
    TypeWellFormedFromEnv(Ty<'tcx>),
}

Variants

Trait(TraitPredicate<'tcx>, Constness)

Corresponds to where Foo: Bar<A, B, C>. Foo here would be the Self type of the trait reference and A, B, and C would be the type parameters.

A trait predicate will have Constness::Const if it originates from a bound on a const fn without the ?const opt-out (e.g., const fn foobar<Foo: Bar>() {}).

RegionOutlives(RegionOutlivesPredicate<'tcx>)

where 'a: 'b

TypeOutlives(TypeOutlivesPredicate<'tcx>)

where T: 'a

Projection(ProjectionPredicate<'tcx>)

where <T as TraitRef>::Name == X, approximately. See the ProjectionPredicate struct for details.

WellFormed(GenericArg<'tcx>)

No syntax: T well-formed.

ObjectSafe(DefId)

Trait must be object-safe.

ClosureKind(DefIdSubstsRef<'tcx>, ClosureKind)

No direct syntax. May be thought of as where T: FnFoo<...> for some substitutions ... and T being a closure type. Satisfied (or refuted) once we know the closure’s kind.

Subtype(SubtypePredicate<'tcx>)

T1 <: T2

ConstEvaluatable(WithOptConstParam<DefId>, SubstsRef<'tcx>)

Constant initializer must evaluate successfully.

ConstEquate(&'tcx Const<'tcx>, &'tcx Const<'tcx>)

Constants must be equal. The first component is the const that is expected.

TypeWellFormedFromEnv(Ty<'tcx>)

Represents a type found in the environment that we can use for implied bounds.

Only used for Chalk.

Trait Implementations

impl<'tcx> Clone for PredicateKind<'tcx>[src]

impl<'tcx> Copy for PredicateKind<'tcx>[src]

impl<'tcx> Debug for PredicateKind<'tcx>[src]

impl<'tcx, __D: TyDecoder<'tcx>> Decodable<__D> for PredicateKind<'tcx>[src]

impl<'tcx> Display for PredicateKind<'tcx>[src]

impl<'tcx, __E: TyEncoder<'tcx>> Encodable<__E> for PredicateKind<'tcx>[src]

impl<'tcx, E: TyEncoder<'tcx>> EncodableWithShorthand<'tcx, E> for PredicateKind<'tcx>[src]

type Variant = PredicateKind<'tcx>

impl<'tcx> Eq for PredicateKind<'tcx>[src]

impl<'tcx> Hash for PredicateKind<'tcx>[src]

impl<'tcx, '__ctx> HashStable<StableHashingContext<'__ctx>> for PredicateKind<'tcx>[src]

impl<'a, 'tcx> Lift<'tcx> for PredicateKind<'a>[src]

type Lifted = PredicateKind<'tcx>

impl<'tcx> PartialEq<PredicateKind<'tcx>> for PredicateKind<'tcx>[src]

impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for PredicateKind<'tcx>[src]

type Output = P

type Error = Error

impl<'tcx> StructuralEq for PredicateKind<'tcx>[src]

impl<'tcx> StructuralPartialEq for PredicateKind<'tcx>[src]

impl<'tcx> ToPredicate<'tcx> for PredicateKind<'tcx>[src]

impl<'tcx> TypeFoldable<'tcx> for PredicateKind<'tcx>[src]

Auto Trait Implementations

impl<'tcx> !RefUnwindSafe for PredicateKind<'tcx>

impl<'tcx> !Send for PredicateKind<'tcx>

impl<'tcx> !Sync for PredicateKind<'tcx>

impl<'tcx> Unpin for PredicateKind<'tcx>

impl<'tcx> !UnwindSafe for PredicateKind<'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
    T: Copy
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

impl<'tcx, T> Subst<'tcx> for T where
    T: TypeFoldable<'tcx>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]