Enum rustc_hir::lang_items::LangItem
source · pub enum LangItem {
Show 142 variants
Sized,
Unsize,
StructuralPeq,
Copy,
Clone,
Sync,
DiscriminantKind,
Discriminant,
PointeeTrait,
Metadata,
DynMetadata,
Freeze,
FnPtrTrait,
FnPtrAddr,
Drop,
Destruct,
CoerceUnsized,
DispatchFromDyn,
TransmuteOpts,
TransmuteTrait,
Add,
Sub,
Mul,
Div,
Rem,
Neg,
Not,
BitXor,
BitAnd,
BitOr,
Shl,
Shr,
AddAssign,
SubAssign,
MulAssign,
DivAssign,
RemAssign,
BitXorAssign,
BitAndAssign,
BitOrAssign,
ShlAssign,
ShrAssign,
Index,
IndexMut,
UnsafeCell,
VaList,
Deref,
DerefMut,
DerefTarget,
Receiver,
Fn,
FnMut,
FnOnce,
AsyncFn,
AsyncFnMut,
AsyncFnOnce,
AsyncFnKindHelper,
FnOnceOutput,
Iterator,
Future,
AsyncIterator,
CoroutineState,
Coroutine,
CoroutineResume,
Unpin,
Pin,
PartialEq,
PartialOrd,
CVoid,
Panic,
PanicNounwind,
PanicFmt,
ConstPanicFmt,
PanicBoundsCheck,
PanicMisalignedPointerDereference,
PanicInfo,
PanicLocation,
PanicImpl,
PanicCannotUnwind,
PanicInCleanup,
BeginPanic,
FormatAlignment,
FormatArgument,
FormatArguments,
FormatCount,
FormatPlaceholder,
FormatUnsafeArg,
ExchangeMalloc,
DropInPlace,
AllocLayout,
Start,
EhPersonality,
EhCatchTypeinfo,
OwnedBox,
GlobalAlloc,
PtrUnique,
PhantomData,
ManuallyDrop,
MaybeUninit,
AlignOffset,
Termination,
Try,
Tuple,
SliceLen,
TryTraitFromResidual,
TryTraitFromOutput,
TryTraitBranch,
TryTraitFromYeet,
PointerLike,
ConstParamTy,
Poll,
PollReady,
PollPending,
AsyncGenReady,
AsyncGenPending,
AsyncGenFinished,
ResumeTy,
GetContext,
Context,
FuturePoll,
AsyncIteratorPollNext,
IntoAsyncIterIntoIter,
Option,
OptionSome,
OptionNone,
ResultOk,
ResultErr,
ControlFlowContinue,
ControlFlowBreak,
IntoFutureIntoFuture,
IntoIterIntoIter,
IteratorNext,
PinNewUnchecked,
RangeFrom,
RangeFull,
RangeInclusiveStruct,
RangeInclusiveNew,
Range,
RangeToInclusive,
RangeTo,
String,
CStr,
}Expand description
A representation of all the valid language items in Rust.
Variants§
Sized
The sized lang item.
Unsize
The unsize lang item.
StructuralPeq
The structural_peq lang item.
Trait injected by #[derive(PartialEq)], (i.e. “Partial EQ”).
Copy
The copy lang item.
Clone
The clone lang item.
Sync
The sync lang item.
DiscriminantKind
The discriminant_kind lang item.
Discriminant
The discriminant_type lang item.
The associated item of the [DiscriminantKind] trait.
PointeeTrait
The pointee_trait lang item.
Metadata
The metadata_type lang item.
DynMetadata
The dyn_metadata lang item.
Freeze
The freeze lang item.
FnPtrTrait
The fn_ptr_trait lang item.
FnPtrAddr
The fn_ptr_addr lang item.
Drop
The drop lang item.
Destruct
The destruct lang item.
CoerceUnsized
The coerce_unsized lang item.
DispatchFromDyn
The dispatch_from_dyn lang item.
TransmuteOpts
The transmute_opts lang item.
TransmuteTrait
The transmute_trait lang item.
Add
The add lang item.
Sub
The sub lang item.
Mul
The mul lang item.
Div
The div lang item.
Rem
The rem lang item.
Neg
The neg lang item.
Not
The not lang item.
BitXor
The bitxor lang item.
BitAnd
The bitand lang item.
BitOr
The bitor lang item.
Shl
The shl lang item.
Shr
The shr lang item.
AddAssign
The add_assign lang item.
SubAssign
The sub_assign lang item.
MulAssign
The mul_assign lang item.
DivAssign
The div_assign lang item.
RemAssign
The rem_assign lang item.
BitXorAssign
The bitxor_assign lang item.
BitAndAssign
The bitand_assign lang item.
BitOrAssign
The bitor_assign lang item.
ShlAssign
The shl_assign lang item.
ShrAssign
The shr_assign lang item.
Index
The index lang item.
IndexMut
The index_mut lang item.
UnsafeCell
The unsafe_cell lang item.
VaList
The va_list lang item.
Deref
The deref lang item.
DerefMut
The deref_mut lang item.
DerefTarget
The deref_target lang item.
Receiver
The receiver lang item.
Fn
The Fn lang item.
FnMut
The fn_mut lang item.
FnOnce
The fn_once lang item.
AsyncFn
The async_fn lang item.
AsyncFnMut
The async_fn_mut lang item.
AsyncFnOnce
The async_fn_once lang item.
AsyncFnKindHelper
The async_fn_kind_helper lang item.
FnOnceOutput
The fn_once_output lang item.
Iterator
The iterator lang item.
Future
The future_trait lang item.
AsyncIterator
The async_iterator lang item.
CoroutineState
The coroutine_state lang item.
Coroutine
The coroutine lang item.
CoroutineResume
The coroutine_resume lang item.
Unpin
The unpin lang item.
Pin
The pin lang item.
PartialEq
The eq lang item.
PartialOrd
The partial_ord lang item.
CVoid
The c_void lang item.
Panic
The panic lang item.
PanicNounwind
The panic_nounwind lang item.
PanicFmt
The panic_fmt lang item.
ConstPanicFmt
The const_panic_fmt lang item.
PanicBoundsCheck
The panic_bounds_check lang item.
PanicMisalignedPointerDereference
The panic_misaligned_pointer_dereference lang item.
PanicInfo
The panic_info lang item.
PanicLocation
The panic_location lang item.
PanicImpl
The panic_impl lang item.
PanicCannotUnwind
The panic_cannot_unwind lang item.
PanicInCleanup
The panic_in_cleanup lang item.
BeginPanic
The begin_panic lang item.
libstd panic entry point. Necessary for const eval to be able to catch it
FormatAlignment
The format_alignment lang item.
FormatArgument
The format_argument lang item.
FormatArguments
The format_arguments lang item.
FormatCount
The format_count lang item.
FormatPlaceholder
The format_placeholder lang item.
FormatUnsafeArg
The format_unsafe_arg lang item.
ExchangeMalloc
The exchange_malloc lang item.
DropInPlace
The drop_in_place lang item.
AllocLayout
The alloc_layout lang item.
Start
The start lang item.
EhPersonality
The eh_personality lang item.
EhCatchTypeinfo
The eh_catch_typeinfo lang item.
OwnedBox
The owned_box lang item.
GlobalAlloc
The global_alloc_ty lang item.
PtrUnique
The ptr_unique lang item.
PhantomData
The phantom_data lang item.
ManuallyDrop
The manually_drop lang item.
MaybeUninit
The maybe_uninit lang item.
AlignOffset
The align_offset lang item.
Align offset for stride != 1; must not panic.
Termination
The termination lang item.
Try
The Try lang item.
Tuple
The tuple_trait lang item.
SliceLen
The slice_len_fn lang item.
TryTraitFromResidual
The from_residual lang item.
TryTraitFromOutput
The from_output lang item.
TryTraitBranch
The branch lang item.
TryTraitFromYeet
The from_yeet lang item.
PointerLike
The pointer_like lang item.
ConstParamTy
The const_param_ty lang item.
Poll
The Poll lang item.
PollReady
The Ready lang item.
PollPending
The Pending lang item.
AsyncGenReady
The AsyncGenReady lang item.
AsyncGenPending
The AsyncGenPending lang item.
AsyncGenFinished
The AsyncGenFinished lang item.
ResumeTy
The ResumeTy lang item.
GetContext
The get_context lang item.
Context
The Context lang item.
FuturePoll
The poll lang item.
AsyncIteratorPollNext
The async_iterator_poll_next lang item.
IntoAsyncIterIntoIter
The into_async_iter_into_iter lang item.
Option
The Option lang item.
OptionSome
The Some lang item.
OptionNone
The None lang item.
ResultOk
The Ok lang item.
ResultErr
The Err lang item.
ControlFlowContinue
The Continue lang item.
ControlFlowBreak
The Break lang item.
IntoFutureIntoFuture
The into_future lang item.
IntoIterIntoIter
The into_iter lang item.
IteratorNext
The next lang item.
PinNewUnchecked
The new_unchecked lang item.
RangeFrom
The RangeFrom lang item.
RangeFull
The RangeFull lang item.
RangeInclusiveStruct
The RangeInclusive lang item.
RangeInclusiveNew
The range_inclusive_new lang item.
Range
The Range lang item.
RangeToInclusive
The RangeToInclusive lang item.
RangeTo
The RangeTo lang item.
String
The String lang item.
CStr
The CStr lang item.
Implementations§
source§impl LangItem
impl LangItem
sourcepub fn name(self) -> Symbol
pub fn name(self) -> Symbol
Returns the name symbol in #[lang = "$name"].
For example, LangItem::PartialEq.name()
would result in sym::eq since it is #[lang = "eq"].
sourcepub fn from_name(name: Symbol) -> Option<Self>
pub fn from_name(name: Symbol) -> Option<Self>
Opposite of LangItem::name
sourcepub fn variant_name(self) -> &'static str
pub fn variant_name(self) -> &'static str
Returns the name of the LangItem enum variant.
pub fn target(self) -> Target
pub fn required_generics(&self) -> GenericRequirement
Trait Implementations§
source§impl<__D: SpanDecoder> Decodable<__D> for LangItem
impl<__D: SpanDecoder> Decodable<__D> for LangItem
source§impl<__E: SpanEncoder> Encodable<__E> for LangItem
impl<__E: SpanEncoder> Encodable<__E> for LangItem
source§impl<CTX> HashStable<CTX> for LangItem
impl<CTX> HashStable<CTX> for LangItem
fn hash_stable(&self, _: &mut CTX, hasher: &mut StableHasher)
source§impl PartialEq for LangItem
impl PartialEq for LangItem
impl Copy for LangItem
impl Eq for LangItem
impl StructuralPartialEq for LangItem
Auto Trait Implementations§
impl DynSend for LangItem
impl DynSync for LangItem
impl Freeze for LangItem
impl RefUnwindSafe for LangItem
impl Send for LangItem
impl Sync for LangItem
impl Unpin for LangItem
impl UnwindSafe for LangItem
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<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a 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<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: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Sized: 0 bytesUnsize: 0 bytesStructuralPeq: 0 bytesCopy: 0 bytesClone: 0 bytesSync: 0 bytesDiscriminantKind: 0 bytesDiscriminant: 0 bytesPointeeTrait: 0 bytesMetadata: 0 bytesDynMetadata: 0 bytesFreeze: 0 bytesFnPtrTrait: 0 bytesFnPtrAddr: 0 bytesDrop: 0 bytesDestruct: 0 bytesCoerceUnsized: 0 bytesDispatchFromDyn: 0 bytesTransmuteOpts: 0 bytesTransmuteTrait: 0 bytesAdd: 0 bytesSub: 0 bytesMul: 0 bytesDiv: 0 bytesRem: 0 bytesNeg: 0 bytesNot: 0 bytesBitXor: 0 bytesBitAnd: 0 bytesBitOr: 0 bytesShl: 0 bytesShr: 0 bytesAddAssign: 0 bytesSubAssign: 0 bytesMulAssign: 0 bytesDivAssign: 0 bytesRemAssign: 0 bytesBitXorAssign: 0 bytesBitAndAssign: 0 bytesBitOrAssign: 0 bytesShlAssign: 0 bytesShrAssign: 0 bytesIndex: 0 bytesIndexMut: 0 bytesUnsafeCell: 0 bytesVaList: 0 bytesDeref: 0 bytesDerefMut: 0 bytesDerefTarget: 0 bytesReceiver: 0 bytesFn: 0 bytesFnMut: 0 bytesFnOnce: 0 bytesAsyncFn: 0 bytesAsyncFnMut: 0 bytesAsyncFnOnce: 0 bytesAsyncFnKindHelper: 0 bytesFnOnceOutput: 0 bytesIterator: 0 bytesFuture: 0 bytesAsyncIterator: 0 bytesCoroutineState: 0 bytesCoroutine: 0 bytesCoroutineResume: 0 bytesUnpin: 0 bytesPin: 0 bytesPartialEq: 0 bytesPartialOrd: 0 bytesCVoid: 0 bytesPanic: 0 bytesPanicNounwind: 0 bytesPanicFmt: 0 bytesConstPanicFmt: 0 bytesPanicBoundsCheck: 0 bytesPanicMisalignedPointerDereference: 0 bytesPanicInfo: 0 bytesPanicLocation: 0 bytesPanicImpl: 0 bytesPanicCannotUnwind: 0 bytesPanicInCleanup: 0 bytesBeginPanic: 0 bytesFormatAlignment: 0 bytesFormatArgument: 0 bytesFormatArguments: 0 bytesFormatCount: 0 bytesFormatPlaceholder: 0 bytesFormatUnsafeArg: 0 bytesExchangeMalloc: 0 bytesDropInPlace: 0 bytesAllocLayout: 0 bytesStart: 0 bytesEhPersonality: 0 bytesEhCatchTypeinfo: 0 bytesOwnedBox: 0 bytesGlobalAlloc: 0 bytesPtrUnique: 0 bytesPhantomData: 0 bytesManuallyDrop: 0 bytesMaybeUninit: 0 bytesAlignOffset: 0 bytesTermination: 0 bytesTry: 0 bytesTuple: 0 bytesSliceLen: 0 bytesTryTraitFromResidual: 0 bytesTryTraitFromOutput: 0 bytesTryTraitBranch: 0 bytesTryTraitFromYeet: 0 bytesPointerLike: 0 bytesConstParamTy: 0 bytesPoll: 0 bytesPollReady: 0 bytesPollPending: 0 bytesAsyncGenReady: 0 bytesAsyncGenPending: 0 bytesAsyncGenFinished: 0 bytesResumeTy: 0 bytesGetContext: 0 bytesContext: 0 bytesFuturePoll: 0 bytesAsyncIteratorPollNext: 0 bytesIntoAsyncIterIntoIter: 0 bytesOption: 0 bytesOptionSome: 0 bytesOptionNone: 0 bytesResultOk: 0 bytesResultErr: 0 bytesControlFlowContinue: 0 bytesControlFlowBreak: 0 bytesIntoFutureIntoFuture: 0 bytesIntoIterIntoIter: 0 bytesIteratorNext: 0 bytesPinNewUnchecked: 0 bytesRangeFrom: 0 bytesRangeFull: 0 bytesRangeInclusiveStruct: 0 bytesRangeInclusiveNew: 0 bytesRange: 0 bytesRangeToInclusive: 0 bytesRangeTo: 0 bytesString: 0 bytesCStr: 0 bytes