Enum rustc_mir_transform::ty::PredicateKind[−][src]

pub enum PredicateKind<'tcx> {
    Trait(TraitPredicate<'tcx>),
    RegionOutlives(OutlivesPredicate<&'tcx RegionKind, &'tcx RegionKind>),
    TypeOutlives(OutlivesPredicate<&'tcx TyS<'tcx>, &'tcx RegionKind>),
    Projection(ProjectionPredicate<'tcx>),
    WellFormed(GenericArg<'tcx>),
    ObjectSafe(DefId),
    ClosureKind(DefId, &'tcx List<GenericArg<'tcx>>, ClosureKind),
    Subtype(SubtypePredicate<'tcx>),
    Coerce(CoercePredicate<'tcx>),
    ConstEvaluatable(Unevaluated<'tcx, ()>),
    ConstEquate(&'tcx Const<'tcx>, &'tcx Const<'tcx>),
    TypeWellFormedFromEnv(&'tcx TyS<'tcx>),
}

Variants

Trait(TraitPredicate<'tcx>)

Tuple Fields

0: TraitPredicate<'tcx>

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.

RegionOutlives(OutlivesPredicate<&'tcx RegionKind, &'tcx RegionKind>)

Tuple Fields

where 'a: 'b

TypeOutlives(OutlivesPredicate<&'tcx TyS<'tcx>, &'tcx RegionKind>)

Tuple Fields

0: OutlivesPredicate<&'tcx TyS<'tcx>, &'tcx RegionKind>

where T: 'a

Projection(ProjectionPredicate<'tcx>)

Tuple Fields

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

WellFormed(GenericArg<'tcx>)

Tuple Fields

0: GenericArg<'tcx>

No syntax: T well-formed.

ObjectSafe(DefId)

Tuple Fields

0: DefId

Trait must be object-safe.

ClosureKind(DefId, &'tcx List<GenericArg<'tcx>>, ClosureKind)

Tuple Fields

0: DefId
1: &'tcx List<GenericArg<'tcx>>

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>)

Tuple Fields

T1 <: T2

This obligation is created most often when we have two unresolved type variables and hence don’t have enough information to process the subtyping obligation yet.

Coerce(CoercePredicate<'tcx>)

Tuple Fields

0: CoercePredicate<'tcx>

T1 coerced to T2

Like a subtyping obligation, this is created most often when we have two unresolved type variables and hence don’t have enough information to process the coercion obligation yet. At the moment, we actually process coercions very much like subtyping and don’t handle the full coercion logic.

ConstEvaluatable(Unevaluated<'tcx, ()>)

Tuple Fields

0: Unevaluated<'tcx, ()>

Constant initializer must evaluate successfully.

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

Tuple Fields

0: &'tcx Const<'tcx>
1: &'tcx Const<'tcx>

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

TypeWellFormedFromEnv(&'tcx TyS<'tcx>)

Tuple Fields

0: &'tcx TyS<'tcx>

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

Only used for Chalk.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes

Size for each variant: