pub enum ConstKind<I>where
I: Interner,{
Param(<I as Interner>::ParamConst),
Infer(InferConst),
Bound(DebruijnIndex, <I as Interner>::BoundConst),
Placeholder(<I as Interner>::PlaceholderConst),
Unevaluated(UnevaluatedConst<I>),
Value(<I as Interner>::Ty, <I as Interner>::ValueConst),
Error(<I as Interner>::ErrorGuaranteed),
Expr(<I as Interner>::ExprConst),
}
Expand description
Represents a constant in Rust.
Variants§
Param(<I as Interner>::ParamConst)
A const generic parameter.
Infer(InferConst)
Infer the value of the const.
Bound(DebruijnIndex, <I as Interner>::BoundConst)
Bound const variable, used only when preparing a trait query.
Placeholder(<I as Interner>::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 as Interner>::Ty, <I as Interner>::ValueConst)
Used to hold computed value.
Error(<I as Interner>::ErrorGuaranteed)
A placeholder for a const which could not be computed; this is propagated to avoid useless error messages.
Expr(<I as Interner>::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, __D> Decodable<__D> for ConstKind<I>where
I: Interner,
__D: TyDecoder<I = I>,
<I as Interner>::ParamConst: Decodable<__D>,
<I as Interner>::BoundConst: Decodable<__D>,
<I as Interner>::PlaceholderConst: Decodable<__D>,
UnevaluatedConst<I>: Decodable<__D>,
<I as Interner>::Ty: Decodable<__D>,
<I as Interner>::ValueConst: Decodable<__D>,
<I as Interner>::ErrorGuaranteed: Decodable<__D>,
<I as Interner>::ExprConst: Decodable<__D>,
impl<I, __D> Decodable<__D> for ConstKind<I>where
I: Interner,
__D: TyDecoder<I = I>,
<I as Interner>::ParamConst: Decodable<__D>,
<I as Interner>::BoundConst: Decodable<__D>,
<I as Interner>::PlaceholderConst: Decodable<__D>,
UnevaluatedConst<I>: Decodable<__D>,
<I as Interner>::Ty: Decodable<__D>,
<I as Interner>::ValueConst: Decodable<__D>,
<I as Interner>::ErrorGuaranteed: Decodable<__D>,
<I as Interner>::ExprConst: Decodable<__D>,
source§impl<I, __E> Encodable<__E> for ConstKind<I>where
I: Interner,
__E: TyEncoder<I = I>,
<I as Interner>::ParamConst: Encodable<__E>,
<I as Interner>::BoundConst: Encodable<__E>,
<I as Interner>::PlaceholderConst: Encodable<__E>,
UnevaluatedConst<I>: Encodable<__E>,
<I as Interner>::Ty: Encodable<__E>,
<I as Interner>::ValueConst: Encodable<__E>,
<I as Interner>::ErrorGuaranteed: Encodable<__E>,
<I as Interner>::ExprConst: Encodable<__E>,
impl<I, __E> Encodable<__E> for ConstKind<I>where
I: Interner,
__E: TyEncoder<I = I>,
<I as Interner>::ParamConst: Encodable<__E>,
<I as Interner>::BoundConst: Encodable<__E>,
<I as Interner>::PlaceholderConst: Encodable<__E>,
UnevaluatedConst<I>: Encodable<__E>,
<I as Interner>::Ty: Encodable<__E>,
<I as Interner>::ValueConst: Encodable<__E>,
<I as Interner>::ErrorGuaranteed: Encodable<__E>,
<I as Interner>::ExprConst: Encodable<__E>,
source§impl<I, __CTX> HashStable<__CTX> for ConstKind<I>where
I: Interner,
<I as Interner>::ParamConst: HashStable<__CTX>,
<I as Interner>::BoundConst: HashStable<__CTX>,
<I as Interner>::PlaceholderConst: HashStable<__CTX>,
UnevaluatedConst<I>: HashStable<__CTX>,
<I as Interner>::Ty: HashStable<__CTX>,
<I as Interner>::ValueConst: HashStable<__CTX>,
<I as Interner>::ErrorGuaranteed: HashStable<__CTX>,
<I as Interner>::ExprConst: HashStable<__CTX>,
impl<I, __CTX> HashStable<__CTX> for ConstKind<I>where
I: Interner,
<I as Interner>::ParamConst: HashStable<__CTX>,
<I as Interner>::BoundConst: HashStable<__CTX>,
<I as Interner>::PlaceholderConst: HashStable<__CTX>,
UnevaluatedConst<I>: HashStable<__CTX>,
<I as Interner>::Ty: HashStable<__CTX>,
<I as Interner>::ValueConst: HashStable<__CTX>,
<I as Interner>::ErrorGuaranteed: HashStable<__CTX>,
<I as Interner>::ExprConst: HashStable<__CTX>,
fn hash_stable( &self, __hcx: &mut __CTX, __hasher: &mut StableHasher<SipHasher128>, )
impl<I> Copy for ConstKind<I>where
I: Interner,
impl<I> Eq for ConstKind<I>where
I: Interner,
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>::Ty: 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>::Ty: 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>::Ty: 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>::Ty: 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>::Ty: 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>::Ty: 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>::Ty: 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>::Ty: 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<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on(self, arena: &'tcx Arena<'tcx>) -> &'tcx mut T
fn allocate_from_iter( arena: &'tcx Arena<'tcx>, iter: impl IntoIterator<Item = T>, ) -> &'tcx mut [T]
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
source§impl<Tcx, T> DepNodeParams<Tcx> for T
impl<Tcx, T> DepNodeParams<Tcx> for T
default fn fingerprint_style() -> FingerprintStyle
source§default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
default fn to_fingerprint(&self, tcx: Tcx) -> Fingerprint
default fn to_debug_str(&self, _: Tcx) -> String
source§default fn recover(_: Tcx, _: &DepNode) -> Option<T>
default fn recover(_: Tcx, _: &DepNode) -> Option<T>
DepNode
,
something which is needed when forcing DepNode
s during red-green
evaluation. The query system will only call this method if
fingerprint_style()
is not FingerprintStyle::Opaque
.
It is always valid to return None
here, in which case incremental
compilation will treat the query as having changed instead of forcing it.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§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> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
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<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
source§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<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> 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,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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.