pub enum ConstKind<I: Interner> {
Param(I::ParamConst),
Infer(InferConst),
Bound(DebruijnIndex, I::BoundConst),
Placeholder(I::PlaceholderConst),
Unevaluated(UnevaluatedConst<I>),
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(UnevaluatedConst<I>)
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, __D: Decoder> Decodable<__D> for ConstKind<I>where
I::ParamConst: Decodable<__D>,
I::BoundConst: Decodable<__D>,
I::PlaceholderConst: Decodable<__D>,
UnevaluatedConst<I>: Decodable<__D>,
I::ValueConst: Decodable<__D>,
I::ErrorGuaranteed: Decodable<__D>,
I::ExprConst: Decodable<__D>,
impl<I: Interner, __D: Decoder> Decodable<__D> for ConstKind<I>where
I::ParamConst: Decodable<__D>,
I::BoundConst: Decodable<__D>,
I::PlaceholderConst: Decodable<__D>,
UnevaluatedConst<I>: Decodable<__D>,
I::ValueConst: Decodable<__D>,
I::ErrorGuaranteed: Decodable<__D>,
I::ExprConst: Decodable<__D>,
Source§impl<I: Interner, __E: Encoder> Encodable<__E> for ConstKind<I>where
I::ParamConst: Encodable<__E>,
I::BoundConst: Encodable<__E>,
I::PlaceholderConst: Encodable<__E>,
UnevaluatedConst<I>: Encodable<__E>,
I::ValueConst: Encodable<__E>,
I::ErrorGuaranteed: Encodable<__E>,
I::ExprConst: Encodable<__E>,
impl<I: Interner, __E: Encoder> Encodable<__E> for ConstKind<I>where
I::ParamConst: Encodable<__E>,
I::BoundConst: Encodable<__E>,
I::PlaceholderConst: Encodable<__E>,
UnevaluatedConst<I>: 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>,
UnevaluatedConst<I>: 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>,
UnevaluatedConst<I>: HashStable<__CTX>,
I::ValueConst: HashStable<__CTX>,
I::ErrorGuaranteed: HashStable<__CTX>,
I::ExprConst: HashStable<__CTX>,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
impl<I> Copy for ConstKind<I>where
I: Interner,
impl<I: Interner> Eq for ConstKind<I>
Auto Trait Implementations§
impl<I> DynSend for ConstKind<I>where
<I as Interner>::ParamConst: DynSend,
<I as Interner>::BoundConst: DynSend,
<I as Interner>::PlaceholderConst: DynSend,
<I as Interner>::ValueConst: DynSend,
<I as Interner>::ErrorGuaranteed: DynSend,
<I as Interner>::ExprConst: DynSend,
<I as Interner>::DefId: DynSend,
<I as Interner>::GenericArgs: DynSend,
impl<I> DynSync for ConstKind<I>where
<I as Interner>::ParamConst: DynSync,
<I as Interner>::BoundConst: DynSync,
<I as Interner>::PlaceholderConst: DynSync,
<I as Interner>::ValueConst: DynSync,
<I as Interner>::ErrorGuaranteed: DynSync,
<I as Interner>::ExprConst: DynSync,
<I as Interner>::DefId: DynSync,
<I as Interner>::GenericArgs: DynSync,
impl<I> Freeze for ConstKind<I>where
<I as Interner>::ParamConst: Freeze,
<I as Interner>::BoundConst: Freeze,
<I as Interner>::PlaceholderConst: Freeze,
<I as Interner>::ValueConst: Freeze,
<I as Interner>::ErrorGuaranteed: Freeze,
<I as Interner>::ExprConst: Freeze,
<I as Interner>::DefId: Freeze,
<I as Interner>::GenericArgs: Freeze,
impl<I> RefUnwindSafe for ConstKind<I>where
<I as Interner>::ParamConst: RefUnwindSafe,
<I as Interner>::BoundConst: RefUnwindSafe,
<I as Interner>::PlaceholderConst: RefUnwindSafe,
<I as Interner>::ValueConst: RefUnwindSafe,
<I as Interner>::ErrorGuaranteed: RefUnwindSafe,
<I as Interner>::ExprConst: RefUnwindSafe,
<I as Interner>::DefId: RefUnwindSafe,
<I as Interner>::GenericArgs: RefUnwindSafe,
impl<I> Send for ConstKind<I>where
<I as Interner>::ParamConst: Send,
<I as Interner>::BoundConst: Send,
<I as Interner>::PlaceholderConst: Send,
<I as Interner>::ValueConst: Send,
<I as Interner>::ErrorGuaranteed: Send,
<I as Interner>::ExprConst: Send,
<I as Interner>::DefId: Send,
<I as Interner>::GenericArgs: Send,
impl<I> Sync for ConstKind<I>where
<I as Interner>::ParamConst: Sync,
<I as Interner>::BoundConst: Sync,
<I as Interner>::PlaceholderConst: Sync,
<I as Interner>::ValueConst: Sync,
<I as Interner>::ErrorGuaranteed: Sync,
<I as Interner>::ExprConst: Sync,
<I as Interner>::DefId: Sync,
<I as Interner>::GenericArgs: Sync,
impl<I> Unpin for ConstKind<I>where
<I as Interner>::ParamConst: Unpin,
<I as Interner>::BoundConst: Unpin,
<I as Interner>::PlaceholderConst: Unpin,
<I as Interner>::ValueConst: Unpin,
<I as Interner>::ErrorGuaranteed: Unpin,
<I as Interner>::ExprConst: Unpin,
<I as Interner>::DefId: Unpin,
<I as Interner>::GenericArgs: Unpin,
impl<I> UnwindSafe for ConstKind<I>where
<I as Interner>::ParamConst: UnwindSafe,
<I as Interner>::BoundConst: UnwindSafe,
<I as Interner>::PlaceholderConst: UnwindSafe,
<I as Interner>::ValueConst: UnwindSafe,
<I as Interner>::ErrorGuaranteed: UnwindSafe,
<I as Interner>::ExprConst: UnwindSafe,
<I as Interner>::DefId: UnwindSafe,
<I as Interner>::GenericArgs: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> 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<T> ErasedDestructor for Twhere
T: 'static,
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.