pub struct DefId(pub(crate) usize);
Expand description
A unique identification number for each item accessible for the current compilation unit.
Tuple Fields§
§0: usize
Implementations§
Source§impl DefId
impl DefId
Sourcepub fn trimmed_name(&self) -> Symbol
pub fn trimmed_name(&self) -> Symbol
Return a trimmed name of this definition.
This can be used to print more user friendly diagnostic messages.
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we trim its path and print only the name.
For example, this function may shorten std::vec::Vec
to just Vec
,
as long as there is no other Vec
importable anywhere.
Trait Implementations§
Source§impl IndexedVal for DefId
impl IndexedVal for DefId
impl Copy for DefId
impl Eq for DefId
impl StructuralPartialEq for DefId
Auto Trait Implementations§
impl Freeze for DefId
impl RefUnwindSafe for DefId
impl Send for DefId
impl Sync for DefId
impl Unpin for DefId
impl UnwindSafe for DefId
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,
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: 8 bytes