Struct rustc_span::hygiene::LocalExpnId
source · [−]pub struct LocalExpnId {
private: u32,
}
Expand description
A unique ID associated with a macro invocation and expansion.
Fields
private: u32
Implementations
sourceimpl LocalExpnId
impl LocalExpnId
sourcepub const MAX_AS_U32: u32 = 4_294_967_040u32
pub const MAX_AS_U32: u32 = 4_294_967_040u32
Maximum value the index can take, as a u32
.
sourcepub const fn from_usize(value: usize) -> Self
pub const fn from_usize(value: usize) -> Self
sourcepub const unsafe fn from_u32_unchecked(value: u32) -> Self
pub const unsafe fn from_u32_unchecked(value: u32) -> Self
Creates a new index from a given u32
.
Safety
The provided value must be less than or equal to the maximum value for the newtype. Providing a value outside this range is undefined due to layout restrictions.
Prefer using from_u32
.
sourceimpl LocalExpnId
impl LocalExpnId
sourcepub const ROOT: LocalExpnId = _
pub const ROOT: LocalExpnId = _
The ID of the theoretical expansion that generates freshly parsed, unexpanded AST.
pub fn from_raw(idx: ExpnIndex) -> LocalExpnId
pub fn as_raw(self) -> ExpnIndex
pub fn fresh_empty() -> LocalExpnId
pub fn fresh(expn_data: ExpnData, ctx: impl HashStableContext) -> LocalExpnId
pub fn expn_hash(self) -> ExpnHash
pub fn expn_data(self) -> ExpnData
pub fn to_expn_id(self) -> ExpnId
pub fn set_expn_data(self, expn_data: ExpnData, ctx: impl HashStableContext)
pub fn is_descendant_of(self, ancestor: LocalExpnId) -> bool
sourcepub fn outer_expn_is_descendant_of(self, ctxt: SyntaxContext) -> bool
pub fn outer_expn_is_descendant_of(self, ctxt: SyntaxContext) -> bool
expn_id.outer_expn_is_descendant_of(ctxt)
is equivalent to but faster than
expn_id.is_descendant_of(ctxt.outer_expn())
.
sourcepub fn expansion_cause(self) -> Option<Span>
pub fn expansion_cause(self) -> Option<Span>
Returns span for the macro which originally caused this expansion to happen.
Stops backtracing at include! boundary.
pub fn parent(self) -> LocalExpnId
Trait Implementations
sourceimpl Add<usize> for LocalExpnId
impl Add<usize> for LocalExpnId
sourceimpl Clone for LocalExpnId
impl Clone for LocalExpnId
sourcefn clone(&self) -> LocalExpnId
fn clone(&self) -> LocalExpnId
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for LocalExpnId
impl Debug for LocalExpnId
sourceimpl From<LocalExpnId> for u32
impl From<LocalExpnId> for u32
sourcefn from(v: LocalExpnId) -> u32
fn from(v: LocalExpnId) -> u32
sourceimpl From<LocalExpnId> for usize
impl From<LocalExpnId> for usize
sourcefn from(v: LocalExpnId) -> usize
fn from(v: LocalExpnId) -> usize
sourceimpl From<u32> for LocalExpnId
impl From<u32> for LocalExpnId
sourceimpl From<usize> for LocalExpnId
impl From<usize> for LocalExpnId
sourceimpl Hash for LocalExpnId
impl Hash for LocalExpnId
sourceimpl Idx for LocalExpnId
impl Idx for LocalExpnId
sourceimpl !Ord for LocalExpnId
impl !Ord for LocalExpnId
sourceimpl PartialEq<LocalExpnId> for LocalExpnId
impl PartialEq<LocalExpnId> for LocalExpnId
sourcefn eq(&self, other: &LocalExpnId) -> bool
fn eq(&self, other: &LocalExpnId) -> bool
sourceimpl !PartialOrd<LocalExpnId> for LocalExpnId
impl !PartialOrd<LocalExpnId> for LocalExpnId
1.0.0 · sourcefn partial_cmp(&self, other: &Rhs) -> Option<Ordering>
fn partial_cmp(&self, other: &Rhs) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for LocalExpnId
impl Eq for LocalExpnId
impl StructuralEq for LocalExpnId
impl StructuralPartialEq for LocalExpnId
Auto Trait Implementations
impl RefUnwindSafe for LocalExpnId
impl Send for LocalExpnId
impl Sync for LocalExpnId
impl Unpin for LocalExpnId
impl UnwindSafe for LocalExpnId
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: 4 bytes