Struct rustc_hir::lang_items::LanguageItems
source · [−]pub struct LanguageItems {
pub items: Vec<Option<DefId>>,
pub missing: Vec<LangItem>,
pub groups: [Vec<DefId>; 2],
}
Expand description
All of the language items, defined or not. Defined lang items can come from the current crate or its dependencies.
Fields
items: Vec<Option<DefId>>
Mappings from lang items to their possibly found DefId
s.
The index corresponds to the order in LangItem
.
missing: Vec<LangItem>
Lang items that were not found during collection.
groups: [Vec<DefId>; 2]
Mapping from LangItemGroup
discriminants to all
DefId
s of lang items in that group.
Implementations
sourceimpl LanguageItems
impl LanguageItems
sourcepub fn items(&self) -> &[Option<DefId>]
pub fn items(&self) -> &[Option<DefId>]
Returns the mappings to the possibly found DefId
s for each lang item.
sourcepub fn require(&self, it: LangItem) -> Result<DefId, LangItemError>
pub fn require(&self, it: LangItem) -> Result<DefId, LangItemError>
Requires that a given LangItem
was bound and returns the corresponding DefId
.
If it wasn’t bound, e.g. due to a missing #[lang = "<it.name()>"]
,
returns an error encapsulating the LangItem
.
sourcepub fn group(&self, group: LangItemGroup) -> &[DefId]
pub fn group(&self, group: LangItemGroup) -> &[DefId]
Returns the DefId
s of all lang items in a group.
sourcepub fn sized_trait(&self) -> Option<DefId>
pub fn sized_trait(&self) -> Option<DefId>
Returns the DefId
of the sized
lang item if it is defined.
sourcepub fn unsize_trait(&self) -> Option<DefId>
pub fn unsize_trait(&self) -> Option<DefId>
Returns the DefId
of the unsize
lang item if it is defined.
sourcepub fn structural_peq_trait(&self) -> Option<DefId>
pub fn structural_peq_trait(&self) -> Option<DefId>
Returns the DefId
of the structural_peq
lang item if it is defined.
sourcepub fn structural_teq_trait(&self) -> Option<DefId>
pub fn structural_teq_trait(&self) -> Option<DefId>
Returns the DefId
of the structural_teq
lang item if it is defined.
sourcepub fn copy_trait(&self) -> Option<DefId>
pub fn copy_trait(&self) -> Option<DefId>
Returns the DefId
of the copy
lang item if it is defined.
sourcepub fn clone_trait(&self) -> Option<DefId>
pub fn clone_trait(&self) -> Option<DefId>
Returns the DefId
of the clone
lang item if it is defined.
sourcepub fn sync_trait(&self) -> Option<DefId>
pub fn sync_trait(&self) -> Option<DefId>
Returns the DefId
of the sync
lang item if it is defined.
sourcepub fn discriminant_kind_trait(&self) -> Option<DefId>
pub fn discriminant_kind_trait(&self) -> Option<DefId>
Returns the DefId
of the discriminant_kind
lang item if it is defined.
sourcepub fn discriminant_type(&self) -> Option<DefId>
pub fn discriminant_type(&self) -> Option<DefId>
Returns the DefId
of the discriminant_type
lang item if it is defined.
sourcepub fn pointee_trait(&self) -> Option<DefId>
pub fn pointee_trait(&self) -> Option<DefId>
Returns the DefId
of the pointee_trait
lang item if it is defined.
sourcepub fn metadata_type(&self) -> Option<DefId>
pub fn metadata_type(&self) -> Option<DefId>
Returns the DefId
of the metadata_type
lang item if it is defined.
sourcepub fn dyn_metadata(&self) -> Option<DefId>
pub fn dyn_metadata(&self) -> Option<DefId>
Returns the DefId
of the dyn_metadata
lang item if it is defined.
sourcepub fn freeze_trait(&self) -> Option<DefId>
pub fn freeze_trait(&self) -> Option<DefId>
Returns the DefId
of the freeze
lang item if it is defined.
sourcepub fn drop_trait(&self) -> Option<DefId>
pub fn drop_trait(&self) -> Option<DefId>
Returns the DefId
of the drop
lang item if it is defined.
sourcepub fn destruct_trait(&self) -> Option<DefId>
pub fn destruct_trait(&self) -> Option<DefId>
Returns the DefId
of the destruct
lang item if it is defined.
sourcepub fn coerce_unsized_trait(&self) -> Option<DefId>
pub fn coerce_unsized_trait(&self) -> Option<DefId>
Returns the DefId
of the coerce_unsized
lang item if it is defined.
sourcepub fn dispatch_from_dyn_trait(&self) -> Option<DefId>
pub fn dispatch_from_dyn_trait(&self) -> Option<DefId>
Returns the DefId
of the dispatch_from_dyn
lang item if it is defined.
sourcepub fn transmute_opts(&self) -> Option<DefId>
pub fn transmute_opts(&self) -> Option<DefId>
Returns the DefId
of the transmute_opts
lang item if it is defined.
sourcepub fn transmute_trait(&self) -> Option<DefId>
pub fn transmute_trait(&self) -> Option<DefId>
Returns the DefId
of the transmute_trait
lang item if it is defined.
sourcepub fn add_trait(&self) -> Option<DefId>
pub fn add_trait(&self) -> Option<DefId>
Returns the DefId
of the add
lang item if it is defined.
sourcepub fn sub_trait(&self) -> Option<DefId>
pub fn sub_trait(&self) -> Option<DefId>
Returns the DefId
of the sub
lang item if it is defined.
sourcepub fn mul_trait(&self) -> Option<DefId>
pub fn mul_trait(&self) -> Option<DefId>
Returns the DefId
of the mul
lang item if it is defined.
sourcepub fn div_trait(&self) -> Option<DefId>
pub fn div_trait(&self) -> Option<DefId>
Returns the DefId
of the div
lang item if it is defined.
sourcepub fn rem_trait(&self) -> Option<DefId>
pub fn rem_trait(&self) -> Option<DefId>
Returns the DefId
of the rem
lang item if it is defined.
sourcepub fn neg_trait(&self) -> Option<DefId>
pub fn neg_trait(&self) -> Option<DefId>
Returns the DefId
of the neg
lang item if it is defined.
sourcepub fn not_trait(&self) -> Option<DefId>
pub fn not_trait(&self) -> Option<DefId>
Returns the DefId
of the not
lang item if it is defined.
sourcepub fn bitxor_trait(&self) -> Option<DefId>
pub fn bitxor_trait(&self) -> Option<DefId>
Returns the DefId
of the bitxor
lang item if it is defined.
sourcepub fn bitand_trait(&self) -> Option<DefId>
pub fn bitand_trait(&self) -> Option<DefId>
Returns the DefId
of the bitand
lang item if it is defined.
sourcepub fn bitor_trait(&self) -> Option<DefId>
pub fn bitor_trait(&self) -> Option<DefId>
Returns the DefId
of the bitor
lang item if it is defined.
sourcepub fn shl_trait(&self) -> Option<DefId>
pub fn shl_trait(&self) -> Option<DefId>
Returns the DefId
of the shl
lang item if it is defined.
sourcepub fn shr_trait(&self) -> Option<DefId>
pub fn shr_trait(&self) -> Option<DefId>
Returns the DefId
of the shr
lang item if it is defined.
sourcepub fn add_assign_trait(&self) -> Option<DefId>
pub fn add_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the add_assign
lang item if it is defined.
sourcepub fn sub_assign_trait(&self) -> Option<DefId>
pub fn sub_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the sub_assign
lang item if it is defined.
sourcepub fn mul_assign_trait(&self) -> Option<DefId>
pub fn mul_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the mul_assign
lang item if it is defined.
sourcepub fn div_assign_trait(&self) -> Option<DefId>
pub fn div_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the div_assign
lang item if it is defined.
sourcepub fn rem_assign_trait(&self) -> Option<DefId>
pub fn rem_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the rem_assign
lang item if it is defined.
sourcepub fn bitxor_assign_trait(&self) -> Option<DefId>
pub fn bitxor_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the bitxor_assign
lang item if it is defined.
sourcepub fn bitand_assign_trait(&self) -> Option<DefId>
pub fn bitand_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the bitand_assign
lang item if it is defined.
sourcepub fn bitor_assign_trait(&self) -> Option<DefId>
pub fn bitor_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the bitor_assign
lang item if it is defined.
sourcepub fn shl_assign_trait(&self) -> Option<DefId>
pub fn shl_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the shl_assign
lang item if it is defined.
sourcepub fn shr_assign_trait(&self) -> Option<DefId>
pub fn shr_assign_trait(&self) -> Option<DefId>
Returns the DefId
of the shr_assign
lang item if it is defined.
sourcepub fn index_trait(&self) -> Option<DefId>
pub fn index_trait(&self) -> Option<DefId>
Returns the DefId
of the index
lang item if it is defined.
sourcepub fn index_mut_trait(&self) -> Option<DefId>
pub fn index_mut_trait(&self) -> Option<DefId>
Returns the DefId
of the index_mut
lang item if it is defined.
sourcepub fn unsafe_cell_type(&self) -> Option<DefId>
pub fn unsafe_cell_type(&self) -> Option<DefId>
Returns the DefId
of the unsafe_cell
lang item if it is defined.
sourcepub fn va_list(&self) -> Option<DefId>
pub fn va_list(&self) -> Option<DefId>
Returns the DefId
of the va_list
lang item if it is defined.
sourcepub fn deref_trait(&self) -> Option<DefId>
pub fn deref_trait(&self) -> Option<DefId>
Returns the DefId
of the deref
lang item if it is defined.
sourcepub fn deref_mut_trait(&self) -> Option<DefId>
pub fn deref_mut_trait(&self) -> Option<DefId>
Returns the DefId
of the deref_mut
lang item if it is defined.
sourcepub fn deref_target(&self) -> Option<DefId>
pub fn deref_target(&self) -> Option<DefId>
Returns the DefId
of the deref_target
lang item if it is defined.
sourcepub fn receiver_trait(&self) -> Option<DefId>
pub fn receiver_trait(&self) -> Option<DefId>
Returns the DefId
of the receiver
lang item if it is defined.
sourcepub fn fn_trait(&self) -> Option<DefId>
pub fn fn_trait(&self) -> Option<DefId>
Returns the DefId
of the Fn
lang item if it is defined.
sourcepub fn fn_mut_trait(&self) -> Option<DefId>
pub fn fn_mut_trait(&self) -> Option<DefId>
Returns the DefId
of the fn_mut
lang item if it is defined.
sourcepub fn fn_once_trait(&self) -> Option<DefId>
pub fn fn_once_trait(&self) -> Option<DefId>
Returns the DefId
of the fn_once
lang item if it is defined.
sourcepub fn fn_once_output(&self) -> Option<DefId>
pub fn fn_once_output(&self) -> Option<DefId>
Returns the DefId
of the fn_once_output
lang item if it is defined.
sourcepub fn future_trait(&self) -> Option<DefId>
pub fn future_trait(&self) -> Option<DefId>
Returns the DefId
of the future_trait
lang item if it is defined.
sourcepub fn gen_state(&self) -> Option<DefId>
pub fn gen_state(&self) -> Option<DefId>
Returns the DefId
of the generator_state
lang item if it is defined.
sourcepub fn gen_trait(&self) -> Option<DefId>
pub fn gen_trait(&self) -> Option<DefId>
Returns the DefId
of the generator
lang item if it is defined.
sourcepub fn unpin_trait(&self) -> Option<DefId>
pub fn unpin_trait(&self) -> Option<DefId>
Returns the DefId
of the unpin
lang item if it is defined.
sourcepub fn pin_type(&self) -> Option<DefId>
pub fn pin_type(&self) -> Option<DefId>
Returns the DefId
of the pin
lang item if it is defined.
sourcepub fn eq_trait(&self) -> Option<DefId>
pub fn eq_trait(&self) -> Option<DefId>
Returns the DefId
of the eq
lang item if it is defined.
sourcepub fn partial_ord_trait(&self) -> Option<DefId>
pub fn partial_ord_trait(&self) -> Option<DefId>
Returns the DefId
of the partial_ord
lang item if it is defined.
sourcepub fn panic_fn(&self) -> Option<DefId>
pub fn panic_fn(&self) -> Option<DefId>
Returns the DefId
of the panic
lang item if it is defined.
sourcepub fn panic_fmt(&self) -> Option<DefId>
pub fn panic_fmt(&self) -> Option<DefId>
Returns the DefId
of the panic_fmt
lang item if it is defined.
sourcepub fn panic_display(&self) -> Option<DefId>
pub fn panic_display(&self) -> Option<DefId>
Returns the DefId
of the panic_display
lang item if it is defined.
sourcepub fn const_panic_fmt(&self) -> Option<DefId>
pub fn const_panic_fmt(&self) -> Option<DefId>
Returns the DefId
of the const_panic_fmt
lang item if it is defined.
sourcepub fn panic_bounds_check_fn(&self) -> Option<DefId>
pub fn panic_bounds_check_fn(&self) -> Option<DefId>
Returns the DefId
of the panic_bounds_check
lang item if it is defined.
sourcepub fn panic_info(&self) -> Option<DefId>
pub fn panic_info(&self) -> Option<DefId>
Returns the DefId
of the panic_info
lang item if it is defined.
sourcepub fn panic_location(&self) -> Option<DefId>
pub fn panic_location(&self) -> Option<DefId>
Returns the DefId
of the panic_location
lang item if it is defined.
sourcepub fn panic_impl(&self) -> Option<DefId>
pub fn panic_impl(&self) -> Option<DefId>
Returns the DefId
of the panic_impl
lang item if it is defined.
sourcepub fn panic_no_unwind(&self) -> Option<DefId>
pub fn panic_no_unwind(&self) -> Option<DefId>
Returns the DefId
of the panic_no_unwind
lang item if it is defined.
sourcepub fn begin_panic_fn(&self) -> Option<DefId>
pub fn begin_panic_fn(&self) -> Option<DefId>
Returns the DefId
of the begin_panic
lang item if it is defined.
sourcepub fn exchange_malloc_fn(&self) -> Option<DefId>
pub fn exchange_malloc_fn(&self) -> Option<DefId>
Returns the DefId
of the exchange_malloc
lang item if it is defined.
sourcepub fn box_free_fn(&self) -> Option<DefId>
pub fn box_free_fn(&self) -> Option<DefId>
Returns the DefId
of the box_free
lang item if it is defined.
sourcepub fn drop_in_place_fn(&self) -> Option<DefId>
pub fn drop_in_place_fn(&self) -> Option<DefId>
Returns the DefId
of the drop_in_place
lang item if it is defined.
sourcepub fn alloc_layout(&self) -> Option<DefId>
pub fn alloc_layout(&self) -> Option<DefId>
Returns the DefId
of the alloc_layout
lang item if it is defined.
sourcepub fn start_fn(&self) -> Option<DefId>
pub fn start_fn(&self) -> Option<DefId>
Returns the DefId
of the start
lang item if it is defined.
sourcepub fn eh_personality(&self) -> Option<DefId>
pub fn eh_personality(&self) -> Option<DefId>
Returns the DefId
of the eh_personality
lang item if it is defined.
sourcepub fn eh_catch_typeinfo(&self) -> Option<DefId>
pub fn eh_catch_typeinfo(&self) -> Option<DefId>
Returns the DefId
of the eh_catch_typeinfo
lang item if it is defined.
sourcepub fn owned_box(&self) -> Option<DefId>
pub fn owned_box(&self) -> Option<DefId>
Returns the DefId
of the owned_box
lang item if it is defined.
sourcepub fn phantom_data(&self) -> Option<DefId>
pub fn phantom_data(&self) -> Option<DefId>
Returns the DefId
of the phantom_data
lang item if it is defined.
sourcepub fn manually_drop(&self) -> Option<DefId>
pub fn manually_drop(&self) -> Option<DefId>
Returns the DefId
of the manually_drop
lang item if it is defined.
sourcepub fn maybe_uninit(&self) -> Option<DefId>
pub fn maybe_uninit(&self) -> Option<DefId>
Returns the DefId
of the maybe_uninit
lang item if it is defined.
sourcepub fn align_offset_fn(&self) -> Option<DefId>
pub fn align_offset_fn(&self) -> Option<DefId>
Returns the DefId
of the align_offset
lang item if it is defined.
sourcepub fn termination(&self) -> Option<DefId>
pub fn termination(&self) -> Option<DefId>
Returns the DefId
of the termination
lang item if it is defined.
sourcepub fn try_trait(&self) -> Option<DefId>
pub fn try_trait(&self) -> Option<DefId>
Returns the DefId
of the Try
lang item if it is defined.
sourcepub fn tuple_trait(&self) -> Option<DefId>
pub fn tuple_trait(&self) -> Option<DefId>
Returns the DefId
of the tuple_trait
lang item if it is defined.
sourcepub fn slice_len_fn(&self) -> Option<DefId>
pub fn slice_len_fn(&self) -> Option<DefId>
Returns the DefId
of the slice_len_fn
lang item if it is defined.
sourcepub fn from_residual_fn(&self) -> Option<DefId>
pub fn from_residual_fn(&self) -> Option<DefId>
Returns the DefId
of the from_residual
lang item if it is defined.
sourcepub fn from_output_fn(&self) -> Option<DefId>
pub fn from_output_fn(&self) -> Option<DefId>
Returns the DefId
of the from_output
lang item if it is defined.
sourcepub fn branch_fn(&self) -> Option<DefId>
pub fn branch_fn(&self) -> Option<DefId>
Returns the DefId
of the branch
lang item if it is defined.
sourcepub fn from_yeet_fn(&self) -> Option<DefId>
pub fn from_yeet_fn(&self) -> Option<DefId>
Returns the DefId
of the from_yeet
lang item if it is defined.
sourcepub fn poll_ready_variant(&self) -> Option<DefId>
pub fn poll_ready_variant(&self) -> Option<DefId>
Returns the DefId
of the Ready
lang item if it is defined.
sourcepub fn poll_pending_variant(&self) -> Option<DefId>
pub fn poll_pending_variant(&self) -> Option<DefId>
Returns the DefId
of the Pending
lang item if it is defined.
sourcepub fn from_generator_fn(&self) -> Option<DefId>
pub fn from_generator_fn(&self) -> Option<DefId>
Returns the DefId
of the from_generator
lang item if it is defined.
sourcepub fn get_context_fn(&self) -> Option<DefId>
pub fn get_context_fn(&self) -> Option<DefId>
Returns the DefId
of the get_context
lang item if it is defined.
sourcepub fn future_poll_fn(&self) -> Option<DefId>
pub fn future_poll_fn(&self) -> Option<DefId>
Returns the DefId
of the poll
lang item if it is defined.
sourcepub fn from_fn(&self) -> Option<DefId>
pub fn from_fn(&self) -> Option<DefId>
Returns the DefId
of the from
lang item if it is defined.
sourcepub fn option_some_variant(&self) -> Option<DefId>
pub fn option_some_variant(&self) -> Option<DefId>
Returns the DefId
of the Some
lang item if it is defined.
sourcepub fn option_none_variant(&self) -> Option<DefId>
pub fn option_none_variant(&self) -> Option<DefId>
Returns the DefId
of the None
lang item if it is defined.
sourcepub fn result_ok_variant(&self) -> Option<DefId>
pub fn result_ok_variant(&self) -> Option<DefId>
Returns the DefId
of the Ok
lang item if it is defined.
sourcepub fn result_err_variant(&self) -> Option<DefId>
pub fn result_err_variant(&self) -> Option<DefId>
Returns the DefId
of the Err
lang item if it is defined.
sourcepub fn cf_continue_variant(&self) -> Option<DefId>
pub fn cf_continue_variant(&self) -> Option<DefId>
Returns the DefId
of the Continue
lang item if it is defined.
sourcepub fn cf_break_variant(&self) -> Option<DefId>
pub fn cf_break_variant(&self) -> Option<DefId>
Returns the DefId
of the Break
lang item if it is defined.
sourcepub fn into_future_fn(&self) -> Option<DefId>
pub fn into_future_fn(&self) -> Option<DefId>
Returns the DefId
of the into_future
lang item if it is defined.
sourcepub fn into_iter_fn(&self) -> Option<DefId>
pub fn into_iter_fn(&self) -> Option<DefId>
Returns the DefId
of the into_iter
lang item if it is defined.
sourcepub fn next_fn(&self) -> Option<DefId>
pub fn next_fn(&self) -> Option<DefId>
Returns the DefId
of the next
lang item if it is defined.
sourcepub fn new_unchecked_fn(&self) -> Option<DefId>
pub fn new_unchecked_fn(&self) -> Option<DefId>
Returns the DefId
of the new_unchecked
lang item if it is defined.
sourcepub fn range_from_struct(&self) -> Option<DefId>
pub fn range_from_struct(&self) -> Option<DefId>
Returns the DefId
of the RangeFrom
lang item if it is defined.
sourcepub fn range_full_struct(&self) -> Option<DefId>
pub fn range_full_struct(&self) -> Option<DefId>
Returns the DefId
of the RangeFull
lang item if it is defined.
sourcepub fn range_inclusive_struct(&self) -> Option<DefId>
pub fn range_inclusive_struct(&self) -> Option<DefId>
Returns the DefId
of the RangeInclusive
lang item if it is defined.
sourcepub fn range_inclusive_new_method(&self) -> Option<DefId>
pub fn range_inclusive_new_method(&self) -> Option<DefId>
Returns the DefId
of the range_inclusive_new
lang item if it is defined.
sourcepub fn range_struct(&self) -> Option<DefId>
pub fn range_struct(&self) -> Option<DefId>
Returns the DefId
of the Range
lang item if it is defined.
sourcepub fn range_to_inclusive_struct(&self) -> Option<DefId>
pub fn range_to_inclusive_struct(&self) -> Option<DefId>
Returns the DefId
of the RangeToInclusive
lang item if it is defined.
sourcepub fn range_to_struct(&self) -> Option<DefId>
pub fn range_to_struct(&self) -> Option<DefId>
Returns the DefId
of the RangeTo
lang item if it is defined.
sourceimpl LanguageItems
impl LanguageItems
pub fn is_weak_lang_item(&self, item_def_id: DefId) -> bool
Trait Implementations
sourceimpl Debug for LanguageItems
impl Debug for LanguageItems
sourceimpl<__CTX> HashStable<__CTX> for LanguageItemswhere
__CTX: HashStableContext,
impl<__CTX> HashStable<__CTX> for LanguageItemswhere
__CTX: HashStableContext,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
Auto Trait Implementations
impl RefUnwindSafe for LanguageItems
impl Send for LanguageItems
impl Sync for LanguageItems
impl Unpin for LanguageItems
impl UnwindSafe for LanguageItems
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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: 96 bytes