ClauseKind in rustc_middle::ty - Rust
Description: API documentation for the Rust `ClauseKind` type in crate `rustc_middle`.

Skip to main content

## ClauseKind

# Type Alias ClauseKind

Source

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

## Aliased Type§

    pub 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(Term<'tcx>),
        ConstEvaluatable(Const<'tcx>),
        HostEffect(HostEffectPredicate<TyCtxt<'tcx>>),
        UnstableFeature(Symbol),
    }

## 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(Term<'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.

§

### UnstableFeature(Symbol)

Support marking impl as unstable.

## Trait Implementations§

Source§

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

Source§

#### fn print(&self, p: &mut P) -> Result<(), PrintError>

## 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.