Enum rustc_type_ir::ConstKind
source · pub enum ConstKind<I: Interner> {
Param(I::ParamConst),
Infer(InferConst),
Bound(DebruijnIndex, I::BoundConst),
Placeholder(I::PlaceholderConst),
Unevaluated(I::AliasConst),
Value(I::ValueConst),
Error(I::ErrorGuaranteed),
Expr(I::ExprConst),
}
Expand description
Represents a constant in Rust.
Variants§
Param(I::ParamConst)
A const generic parameter.
Infer(InferConst)
Infer the value of the const.
Bound(DebruijnIndex, I::BoundConst)
Bound const variable, used only when preparing a trait query.
Placeholder(I::PlaceholderConst)
A placeholder const - universally quantified higher-ranked const.
Unevaluated(I::AliasConst)
An unnormalized const item such as an anon const or assoc const or free const item. Right now anything other than anon consts does not actually work properly but this should
Value(I::ValueConst)
Used to hold computed value.
Error(I::ErrorGuaranteed)
A placeholder for a const which could not be computed; this is propagated to avoid useless error messages.
Expr(I::ExprConst)
Unevaluated non-const-item, used by feature(generic_const_exprs)
to represent
const arguments such as N + 1
or foo(N)
Trait Implementations§
source§impl<I: Interner> DebugWithInfcx<I> for ConstKind<I>
impl<I: Interner> DebugWithInfcx<I> for ConstKind<I>
source§impl<I: Interner, __D: TyDecoder<I = I>> Decodable<__D> for ConstKind<I>where
I::ParamConst: Decodable<__D>,
I::BoundConst: Decodable<__D>,
I::PlaceholderConst: Decodable<__D>,
I::AliasConst: Decodable<__D>,
I::ValueConst: Decodable<__D>,
I::ErrorGuaranteed: Decodable<__D>,
I::ExprConst: Decodable<__D>,
impl<I: Interner, __D: TyDecoder<I = I>> Decodable<__D> for ConstKind<I>where
I::ParamConst: Decodable<__D>,
I::BoundConst: Decodable<__D>,
I::PlaceholderConst: Decodable<__D>,
I::AliasConst: Decodable<__D>,
I::ValueConst: Decodable<__D>,
I::ErrorGuaranteed: Decodable<__D>,
I::ExprConst: Decodable<__D>,
source§impl<I: Interner, __E: TyEncoder<I = I>> Encodable<__E> for ConstKind<I>where
I::ParamConst: Encodable<__E>,
I::BoundConst: Encodable<__E>,
I::PlaceholderConst: Encodable<__E>,
I::AliasConst: Encodable<__E>,
I::ValueConst: Encodable<__E>,
I::ErrorGuaranteed: Encodable<__E>,
I::ExprConst: Encodable<__E>,
impl<I: Interner, __E: TyEncoder<I = I>> Encodable<__E> for ConstKind<I>where
I::ParamConst: Encodable<__E>,
I::BoundConst: Encodable<__E>,
I::PlaceholderConst: Encodable<__E>,
I::AliasConst: Encodable<__E>,
I::ValueConst: Encodable<__E>,
I::ErrorGuaranteed: Encodable<__E>,
I::ExprConst: Encodable<__E>,
source§impl<I: Interner, __CTX> HashStable<__CTX> for ConstKind<I>where
I::ParamConst: HashStable<__CTX>,
I::BoundConst: HashStable<__CTX>,
I::PlaceholderConst: HashStable<__CTX>,
I::AliasConst: HashStable<__CTX>,
I::ValueConst: HashStable<__CTX>,
I::ErrorGuaranteed: HashStable<__CTX>,
I::ExprConst: HashStable<__CTX>,
impl<I: Interner, __CTX> HashStable<__CTX> for ConstKind<I>where
I::ParamConst: HashStable<__CTX>,
I::BoundConst: HashStable<__CTX>,
I::PlaceholderConst: HashStable<__CTX>,
I::AliasConst: HashStable<__CTX>,
I::ValueConst: HashStable<__CTX>,
I::ErrorGuaranteed: HashStable<__CTX>,
I::ExprConst: HashStable<__CTX>,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
source§impl<I: Interner> Ord for ConstKind<I>
impl<I: Interner> Ord for ConstKind<I>
source§impl<I: Interner> PartialEq for ConstKind<I>
impl<I: Interner> PartialEq for ConstKind<I>
source§impl<I: Interner> PartialOrd for ConstKind<I>
impl<I: Interner> PartialOrd for ConstKind<I>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl<I: Interner> Copy for ConstKind<I>
impl<I: Interner> Eq for ConstKind<I>
Auto Trait Implementations§
impl<I> DynSend for ConstKind<I>where
<I as Interner>::AliasConst: DynSend,
<I as Interner>::BoundConst: DynSend,
<I as Interner>::ErrorGuaranteed: DynSend,
<I as Interner>::ExprConst: DynSend,
<I as Interner>::ParamConst: DynSend,
<I as Interner>::PlaceholderConst: DynSend,
<I as Interner>::ValueConst: DynSend,
impl<I> DynSync for ConstKind<I>where
<I as Interner>::AliasConst: DynSync,
<I as Interner>::BoundConst: DynSync,
<I as Interner>::ErrorGuaranteed: DynSync,
<I as Interner>::ExprConst: DynSync,
<I as Interner>::ParamConst: DynSync,
<I as Interner>::PlaceholderConst: DynSync,
<I as Interner>::ValueConst: DynSync,
impl<I> Freeze for ConstKind<I>where
<I as Interner>::AliasConst: Freeze,
<I as Interner>::BoundConst: Freeze,
<I as Interner>::ErrorGuaranteed: Freeze,
<I as Interner>::ExprConst: Freeze,
<I as Interner>::ParamConst: Freeze,
<I as Interner>::PlaceholderConst: Freeze,
<I as Interner>::ValueConst: Freeze,
impl<I> RefUnwindSafe for ConstKind<I>where
<I as Interner>::AliasConst: RefUnwindSafe,
<I as Interner>::BoundConst: RefUnwindSafe,
<I as Interner>::ErrorGuaranteed: RefUnwindSafe,
<I as Interner>::ExprConst: RefUnwindSafe,
<I as Interner>::ParamConst: RefUnwindSafe,
<I as Interner>::PlaceholderConst: RefUnwindSafe,
<I as Interner>::ValueConst: RefUnwindSafe,
impl<I> Send for ConstKind<I>where
<I as Interner>::AliasConst: Send,
<I as Interner>::BoundConst: Send,
<I as Interner>::ErrorGuaranteed: Send,
<I as Interner>::ExprConst: Send,
<I as Interner>::ParamConst: Send,
<I as Interner>::PlaceholderConst: Send,
<I as Interner>::ValueConst: Send,
impl<I> Sync for ConstKind<I>where
<I as Interner>::AliasConst: Sync,
<I as Interner>::BoundConst: Sync,
<I as Interner>::ErrorGuaranteed: Sync,
<I as Interner>::ExprConst: Sync,
<I as Interner>::ParamConst: Sync,
<I as Interner>::PlaceholderConst: Sync,
<I as Interner>::ValueConst: Sync,
impl<I> Unpin for ConstKind<I>where
<I as Interner>::AliasConst: Unpin,
<I as Interner>::BoundConst: Unpin,
<I as Interner>::ErrorGuaranteed: Unpin,
<I as Interner>::ExprConst: Unpin,
<I as Interner>::ParamConst: Unpin,
<I as Interner>::PlaceholderConst: Unpin,
<I as Interner>::ValueConst: Unpin,
impl<I> UnwindSafe for ConstKind<I>where
<I as Interner>::AliasConst: UnwindSafe,
<I as Interner>::BoundConst: UnwindSafe,
<I as Interner>::ErrorGuaranteed: UnwindSafe,
<I as Interner>::ExprConst: UnwindSafe,
<I as Interner>::ParamConst: UnwindSafe,
<I as Interner>::PlaceholderConst: UnwindSafe,
<I as Interner>::ValueConst: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
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.