[−][src]Enum rustc_middle::ty::PredicateAtom

pub enum PredicateAtom<'tcx> {
    Trait(TraitPredicate<'tcx>, Constness),
    RegionOutlives(RegionOutlivesPredicate<'tcx>),
    TypeOutlives(TypeOutlivesPredicate<'tcx>),
    Projection(ProjectionPredicate<'tcx>),
    WellFormed(GenericArg<'tcx>),
    ObjectSafe(DefId),
    ClosureKind(DefId, SubstsRef<'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(DefId, SubstsRef<'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.

Implementations

impl<'tcx> PredicateAtom<'tcx>[src]

pub fn potentially_quantified(
    self,
    tcx: TyCtxt<'tcx>,
    qualifier: impl FnOnce(Binder<PredicateAtom<'tcx>>) -> PredicateKind<'tcx>
) -> Predicate<'tcx>
[src]

Wraps self with the given qualifier if this predicate has any unbound variables.

Trait Implementations

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

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

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

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

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

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

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

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

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

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

type Lifted = PredicateAtom<'tcx>

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

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

type Output = P

type Error = Error

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

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

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

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

Auto Trait Implementations

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

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

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

impl<'tcx> Unpin for PredicateAtom<'tcx>

impl<'tcx> !UnwindSafe for PredicateAtom<'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]