[][src]Enum rustc::ty::Predicate

pub enum Predicate<'tcx> {
    Trait(PolyTraitPredicate<'tcx>, Constness),
    RegionOutlives(PolyRegionOutlivesPredicate<'tcx>),
    TypeOutlives(PolyTypeOutlivesPredicate<'tcx>),
    Projection(PolyProjectionPredicate<'tcx>),
    WellFormed(Ty<'tcx>),
    ObjectSafe(DefId),
    ClosureKind(DefIdSubstsRef<'tcx>, ClosureKind),
    Subtype(PolySubtypePredicate<'tcx>),
    ConstEvaluatable(DefIdSubstsRef<'tcx>),
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Variants

Trait(PolyTraitPredicate<'tcx>, Constness)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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(PolyRegionOutlivesPredicate<'tcx>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

where 'a: 'b

TypeOutlives(PolyTypeOutlivesPredicate<'tcx>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

where T: 'a

Projection(PolyProjectionPredicate<'tcx>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

WellFormed(Ty<'tcx>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

No syntax: T well-formed.

ObjectSafe(DefId)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait must be object-safe.

ClosureKind(DefIdSubstsRef<'tcx>, ClosureKind)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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(PolySubtypePredicate<'tcx>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

T1 <: T2

ConstEvaluatable(DefIdSubstsRef<'tcx>)
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Constant initializer must evaluate successfully.

Methods

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

pub fn subst_supertrait(
    &self,
    tcx: TyCtxt<'tcx>,
    trait_ref: &PolyTraitRef<'tcx>
) -> Predicate<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Performs a substitution suitable for going from a poly-trait-ref to supertraits that must hold if that poly-trait-ref holds. This is slightly different from a normal substitution in terms of what happens with bound regions. See lengthy comment below for details.

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

pub fn walk_tys<'a>(&'a self) -> impl Iterator<Item = Ty<'tcx>> + 'a[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Iterates over the types in this predicate. Note that in all cases this is skipping over a binder, so late-bound regions with depth 0 are bound by the predicate.

pub fn to_opt_poly_trait_ref(&self) -> Option<PolyTraitRef<'tcx>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn to_opt_type_outlives(&self) -> Option<PolyTypeOutlivesPredicate<'tcx>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait Implementations

impl<'tcx> AsRef<Predicate<'tcx>> for Predicate<'tcx>[src]

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

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

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

impl<'tcx> Decodable for Predicate<'tcx>[src]

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

impl<'tcx> Encodable for Predicate<'tcx>[src]

impl<'tcx> EncodableWithShorthand for Predicate<'tcx>[src]

type Variant = Predicate<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

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

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

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

type Lifted = Predicate<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'tcx> Normalizable<'tcx> for Predicate<'tcx>[src]

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

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

type Output = P

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Error = Error

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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

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

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

Auto Trait Implementations

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

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

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

impl<'tcx> Unpin for Predicate<'tcx>

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

Blanket Implementations

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

impl<T> ArenaAllocatable 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> Decodable for T where
    T: UseSpecializedDecodable
[src]

impl<T> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T[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 = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<E> SpecializationError for E[src]

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]