Enum rustc_query_impl::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
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
impl<Ctxt, T> DepNodeParams<Ctxt> for T where
Ctxt: DepContext,
T: for<'a> HashStable<StableHashingContext<'a>> + Debug,
This method turns the parameters of a DepNodeConstructor into an opaque Fingerprint to be used in DepNode. Not all DepNodeParams support being turned into a Fingerprint (they don’t need to if the corresponding DepNode is anonymous). Read more
This method tries to recover the query key from the given DepNode,
something which is needed when forcing DepNodes during red-green
evaluation. The query system will only call this method if
fingerprint_style() is not FingerprintStyle::Opaque.
It is always valid to return None here, in which case incremental
compilation will treat the query as having changed instead of forcing it. 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