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
0: OutlivesPredicate<&'tcx RegionKind, &'tcx RegionKind>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
0: ProjectionPredicate<'tcx>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: DefIdTrait must be object-safe.
ClosureKind(DefId, &'tcx List<GenericArg<'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>)
Tuple Fields
0: SubtypePredicate<'tcx>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>)
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
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
Mutably borrows from an owned value. Read more
pub fn subst_spanned(
self,
tcx: TyCtxt<'tcx>,
substs: &[GenericArg<'tcx>],
span: Option<Span>
) -> T
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:
Trait: 31 bytesRegionOutlives: 23 bytesTypeOutlives: 23 bytesProjection: 31 bytesWellFormed: 15 bytesObjectSafe: 11 bytesClosureKind: 23 bytesSubtype: 31 bytesCoerce: 23 bytesConstEvaluatable: 31 bytesConstEquate: 23 bytesTypeWellFormedFromEnv: 15 bytes