rustc_middle::ty::predicate

Type Alias ClauseKind

Source
pub type ClauseKind<'tcx> = ClauseKind<TyCtxt<'tcx>>;

Aliased Type§

enum ClauseKind<'tcx> {
    Trait(TraitPredicate<TyCtxt<'tcx>>),
    RegionOutlives(OutlivesPredicate<TyCtxt<'tcx>, Region<'tcx>>),
    TypeOutlives(OutlivesPredicate<TyCtxt<'tcx>, Ty<'tcx>>),
    Projection(ProjectionPredicate<TyCtxt<'tcx>>),
    ConstArgHasType(Const<'tcx>, Ty<'tcx>),
    WellFormed(GenericArg<'tcx>),
    ConstEvaluatable(Const<'tcx>),
    HostEffect(HostEffectPredicate<TyCtxt<'tcx>>),
}

Variants§

§

Trait(TraitPredicate<TyCtxt<'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<TyCtxt<'tcx>, Region<'tcx>>)

where 'a: 'r

§

TypeOutlives(OutlivesPredicate<TyCtxt<'tcx>, Ty<'tcx>>)

where T: 'r

§

Projection(ProjectionPredicate<TyCtxt<'tcx>>)

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

§

ConstArgHasType(Const<'tcx>, Ty<'tcx>)

Ensures that a const generic argument to a parameter const N: u8 is of type u8.

§

WellFormed(GenericArg<'tcx>)

No syntax: T well-formed.

§

ConstEvaluatable(Const<'tcx>)

Constant initializer must evaluate successfully.

§

HostEffect(HostEffectPredicate<TyCtxt<'tcx>>)

Enforces the constness of the predicate we’re calling. Like a projection goal from a where clause, it’s always going to be paired with a corresponding trait clause; this just enforces the constness of that implementation.

Trait Implementations§

Source§

impl<'tcx> EraseType for ClauseKind<'tcx>

Source§

type Result = [u8; 32]

Source§

impl ParameterizedOverTcx for ClauseKind<'static>

Source§

type Value<'tcx> = ClauseKind<TyCtxt<'tcx>>

Source§

impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for ClauseKind<'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:

  • Trait: 24 bytes
  • RegionOutlives: 16 bytes
  • TypeOutlives: 16 bytes
  • Projection: 24 bytes
  • ConstArgHasType: 16 bytes
  • WellFormed: 8 bytes
  • ConstEvaluatable: 8 bytes
  • HostEffect: 24 bytes