Skip to main content

ClauseKind

Type Alias ClauseKind 

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

Aliased Type§

pub enum ClauseKind<'tcx> {
    Trait(TraitClause<TyCtxt<'tcx>>),
    RegionOutlives(OutlivesClause<TyCtxt<'tcx>, Region<TyCtxt<'tcx>>>),
    TypeOutlives(OutlivesClause<TyCtxt<'tcx>, Ty<'tcx>>),
    Projection(ProjectionClause<TyCtxt<'tcx>>),
    ConstArgHasType(Const<TyCtxt<'tcx>>, Ty<'tcx>),
    WellFormed(Term<'tcx>),
    ConstEvaluatable(Const<TyCtxt<'tcx>>),
    HostEffect(HostEffectClause<TyCtxt<'tcx>>),
    UnstableFeature(Symbol),
    CompressedTrait(CompressedTraitClause<TyCtxt<'tcx>>),
}

Variants§

§

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

where 'a: 'r

§

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

where T: 'r

§

Projection(ProjectionClause<TyCtxt<'tcx>>)

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

§

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

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

§

WellFormed(Term<'tcx>)

No syntax: T well-formed.

§

ConstEvaluatable(Const<TyCtxt<'tcx>>)

Constant initializer must evaluate successfully.

§

HostEffect(HostEffectClause<TyCtxt<'tcx>>)

Enforces the constness of the clause 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.

§

UnstableFeature(Symbol)

Support marking impl as unstable.

§

CompressedTrait(CompressedTraitClause<TyCtxt<'tcx>>)

You never have to deal with this. It’s an implementation detail of how ParamEnvs are stored. It represents a couple of very simple, super common clauses as a bitset, and gets interned as one. This variant is created behind the scenes, when constructing a ParamEnv, but when iterating over a ParamEnv these are flattened out and reified into their corresponding real clauses.

There’s some complexity surrounding these clauses in TypeFoldable and TypeVisitable, to make sure that there these bitsets are also properly reified.

Trait Implementations§

Source§

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

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.