pub type PredicateKind<'tcx> = PredicateKind<TyCtxt<'tcx>>;
Aliased Type§
enum PredicateKind<'tcx> {
Clause(ClauseKind<TyCtxt<'tcx>>),
DynCompatible(DefId),
Subtype(SubtypePredicate<TyCtxt<'tcx>>),
Coerce(CoercePredicate<TyCtxt<'tcx>>),
ConstEquate(Const<'tcx>, Const<'tcx>),
Ambiguous,
NormalizesTo(NormalizesTo<TyCtxt<'tcx>>),
AliasRelate(Term<'tcx>, Term<'tcx>, AliasRelationDirection),
}
Variants§
Clause(ClauseKind<TyCtxt<'tcx>>)
Prove a clause
DynCompatible(DefId)
Trait must be dyn-compatible.
Subtype(SubtypePredicate<TyCtxt<'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<TyCtxt<'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.
ConstEquate(Const<'tcx>, Const<'tcx>)
Constants must be equal. The first component is the const that is expected.
Ambiguous
A marker predicate that is always ambiguous. Used for coherence to mark opaque types as possibly equal to each other but ambiguous.
NormalizesTo(NormalizesTo<TyCtxt<'tcx>>)
This should only be used inside of the new solver for AliasRelate
and expects
the term
to be always be an unconstrained inference variable. It is used to
normalize alias
as much as possible. In case the alias is rigid - i.e. it cannot
be normalized in the current environment - this constrains term
to be equal to
the alias itself.
It is likely more useful to think of this as a function normalizes_to(alias)
,
whose return value is written into term
.
AliasRelate(Term<'tcx>, Term<'tcx>, AliasRelationDirection)
Separate from ClauseKind::Projection
which is used for normalization in new solver.
This predicate requires two terms to be equal to eachother.
Only used for new solver.
Trait Implementations§
Source§impl<'tcx, E: TyEncoder<I = TyCtxt<'tcx>>> EncodableWithShorthand<E> for PredicateKind<'tcx>
impl<'tcx, E: TyEncoder<I = TyCtxt<'tcx>>> EncodableWithShorthand<E> for PredicateKind<'tcx>
Source§impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for PredicateKind<'tcx>
impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for PredicateKind<'tcx>
Source§impl<I> Clone for PredicateKind<I>where
I: Interner,
impl<I> Clone for PredicateKind<I>where
I: Interner,
Source§fn clone(&self) -> PredicateKind<I>
fn clone(&self) -> PredicateKind<I>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<I> Debug for PredicateKind<I>where
I: Interner,
impl<I> Debug for PredicateKind<I>where
I: Interner,
Source§impl<I, __D> Decodable<__D> for PredicateKind<I>where
I: Interner,
__D: TyDecoder<I = I>,
ClauseKind<I>: Decodable<__D>,
<I as Interner>::DefId: Decodable<__D>,
SubtypePredicate<I>: Decodable<__D>,
CoercePredicate<I>: Decodable<__D>,
<I as Interner>::Const: Decodable<__D>,
NormalizesTo<I>: Decodable<__D>,
<I as Interner>::Term: Decodable<__D>,
impl<I, __D> Decodable<__D> for PredicateKind<I>where
I: Interner,
__D: TyDecoder<I = I>,
ClauseKind<I>: Decodable<__D>,
<I as Interner>::DefId: Decodable<__D>,
SubtypePredicate<I>: Decodable<__D>,
CoercePredicate<I>: Decodable<__D>,
<I as Interner>::Const: Decodable<__D>,
NormalizesTo<I>: Decodable<__D>,
<I as Interner>::Term: Decodable<__D>,
fn decode(__decoder: &mut __D) -> PredicateKind<I>
Source§impl<I, __E> Encodable<__E> for PredicateKind<I>where
I: Interner,
__E: TyEncoder<I = I>,
ClauseKind<I>: Encodable<__E>,
<I as Interner>::DefId: Encodable<__E>,
SubtypePredicate<I>: Encodable<__E>,
CoercePredicate<I>: Encodable<__E>,
<I as Interner>::Const: Encodable<__E>,
NormalizesTo<I>: Encodable<__E>,
<I as Interner>::Term: Encodable<__E>,
impl<I, __E> Encodable<__E> for PredicateKind<I>where
I: Interner,
__E: TyEncoder<I = I>,
ClauseKind<I>: Encodable<__E>,
<I as Interner>::DefId: Encodable<__E>,
SubtypePredicate<I>: Encodable<__E>,
CoercePredicate<I>: Encodable<__E>,
<I as Interner>::Const: Encodable<__E>,
NormalizesTo<I>: Encodable<__E>,
<I as Interner>::Term: Encodable<__E>,
Source§impl<I> Hash for PredicateKind<I>where
I: Interner,
impl<I> Hash for PredicateKind<I>where
I: Interner,
Source§impl<I, __CTX> HashStable<__CTX> for PredicateKind<I>where
I: Interner,
ClauseKind<I>: HashStable<__CTX>,
<I as Interner>::DefId: HashStable<__CTX>,
SubtypePredicate<I>: HashStable<__CTX>,
CoercePredicate<I>: HashStable<__CTX>,
<I as Interner>::Const: HashStable<__CTX>,
NormalizesTo<I>: HashStable<__CTX>,
<I as Interner>::Term: HashStable<__CTX>,
impl<I, __CTX> HashStable<__CTX> for PredicateKind<I>where
I: Interner,
ClauseKind<I>: HashStable<__CTX>,
<I as Interner>::DefId: HashStable<__CTX>,
SubtypePredicate<I>: HashStable<__CTX>,
CoercePredicate<I>: HashStable<__CTX>,
<I as Interner>::Const: HashStable<__CTX>,
NormalizesTo<I>: HashStable<__CTX>,
<I as Interner>::Term: HashStable<__CTX>,
fn hash_stable( &self, __hcx: &mut __CTX, __hasher: &mut StableHasher<SipHasher128>, )
Source§impl<I> PartialEq for PredicateKind<I>where
I: Interner,
impl<I> PartialEq for PredicateKind<I>where
I: Interner,
Source§impl<I> TypeFoldable<I> for PredicateKind<I>where
I: Interner,
ClauseKind<I>: TypeFoldable<I>,
<I as Interner>::DefId: TypeFoldable<I>,
SubtypePredicate<I>: TypeFoldable<I>,
CoercePredicate<I>: TypeFoldable<I>,
<I as Interner>::Const: TypeFoldable<I>,
NormalizesTo<I>: TypeFoldable<I>,
<I as Interner>::Term: TypeFoldable<I>,
impl<I> TypeFoldable<I> for PredicateKind<I>where
I: Interner,
ClauseKind<I>: TypeFoldable<I>,
<I as Interner>::DefId: TypeFoldable<I>,
SubtypePredicate<I>: TypeFoldable<I>,
CoercePredicate<I>: TypeFoldable<I>,
<I as Interner>::Const: TypeFoldable<I>,
NormalizesTo<I>: TypeFoldable<I>,
<I as Interner>::Term: TypeFoldable<I>,
Source§fn try_fold_with<__F>(
self,
__folder: &mut __F,
) -> Result<PredicateKind<I>, <__F as FallibleTypeFolder<I>>::Error>where
__F: FallibleTypeFolder<I>,
fn try_fold_with<__F>(
self,
__folder: &mut __F,
) -> Result<PredicateKind<I>, <__F as FallibleTypeFolder<I>>::Error>where
__F: FallibleTypeFolder<I>,
Source§fn fold_with<F>(self, folder: &mut F) -> Selfwhere
F: TypeFolder<I>,
fn fold_with<F>(self, folder: &mut F) -> Selfwhere
F: TypeFolder<I>,
try_fold_with
for use with infallible
folders. Do not override this method, to ensure coherence with
try_fold_with
.Source§impl<I> TypeVisitable<I> for PredicateKind<I>where
I: Interner,
ClauseKind<I>: TypeVisitable<I>,
<I as Interner>::DefId: TypeVisitable<I>,
SubtypePredicate<I>: TypeVisitable<I>,
CoercePredicate<I>: TypeVisitable<I>,
<I as Interner>::Const: TypeVisitable<I>,
NormalizesTo<I>: TypeVisitable<I>,
<I as Interner>::Term: TypeVisitable<I>,
impl<I> TypeVisitable<I> for PredicateKind<I>where
I: Interner,
ClauseKind<I>: TypeVisitable<I>,
<I as Interner>::DefId: TypeVisitable<I>,
SubtypePredicate<I>: TypeVisitable<I>,
CoercePredicate<I>: TypeVisitable<I>,
<I as Interner>::Const: TypeVisitable<I>,
NormalizesTo<I>: TypeVisitable<I>,
<I as Interner>::Term: TypeVisitable<I>,
Source§fn visit_with<__V>(
&self,
__visitor: &mut __V,
) -> <__V as TypeVisitor<I>>::Resultwhere
__V: TypeVisitor<I>,
fn visit_with<__V>(
&self,
__visitor: &mut __V,
) -> <__V as TypeVisitor<I>>::Resultwhere
__V: TypeVisitor<I>,
impl<I> Copy for PredicateKind<I>where
I: Interner,
impl<I> Eq for PredicateKind<I>where
I: Interner,
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:
Clause
: 32 bytesDynCompatible
: 16 bytesSubtype
: 32 bytesCoerce
: 24 bytesConstEquate
: 24 bytesAmbiguous
: 0 bytesNormalizesTo
: 32 bytesAliasRelate
: 32 bytes