pub type PredicateKind<'tcx> = PredicateKind<TyCtxt<'tcx>>;

Aliased Type§

enum PredicateKind<'tcx> {
    Clause(ClauseKind<TyCtxt<'tcx>>),
    ObjectSafe(DefId),
    Subtype(SubtypePredicate<'tcx>),
    Coerce(CoercePredicate<'tcx>),
    ConstEquate(Const<'tcx>, Const<'tcx>),
    Ambiguous,
    NormalizesTo(NormalizesTo<'tcx>),
    AliasRelate(Term<'tcx>, Term<'tcx>, AliasRelationDirection),
}

Variants§

§

Clause(ClauseKind<TyCtxt<'tcx>>)

Prove a clause

§

ObjectSafe(DefId)

Trait must be object-safe.

§

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

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

The alias normalizes to term. Unlike Projection, this always fails if the alias cannot be normalized in the current context.

Projection(<T as Trait>::Assoc, ?x) results in ?x == <T as Trait>::Assoc while NormalizesTo(<T as Trait>::Assoc, ?x) results in NoSolution.

Only used in the new solver.

§

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>

§

type Variant = PredicateKind<TyCtxt<'tcx>>

source§

fn variant(&self) -> &Self::Variant

source§

impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for PredicateKind<'tcx>

source§

impl<'tcx> ToPredicate<'tcx> for PredicateKind<'tcx>

source§

fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx>

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 bytes
  • ObjectSafe: 16 bytes
  • Subtype: 32 bytes
  • Coerce: 24 bytes
  • ConstEquate: 24 bytes
  • Ambiguous: 0 bytes
  • NormalizesTo: 32 bytes
  • AliasRelate: 32 bytes