Struct rustc_span::hygiene::HygieneData[−][src]

pub struct HygieneData {
    expn_data: Vec<Option<ExpnData>>,
    syntax_context_data: Vec<SyntaxContextData>,
    syntax_context_map: FxHashMap<(SyntaxContext, ExpnId, Transparency), SyntaxContext>,
    expn_data_disambiguators: FxHashMap<Fingerprint, u32>,
}

Fields

expn_data: Vec<Option<ExpnData>>
Expand description

Each expansion should have an associated expansion data, but sometimes there’s a delay between creation of an expansion ID and obtaining its data (e.g. macros are collected first and then resolved later), so we use an Option here.

syntax_context_data: Vec<SyntaxContextData>syntax_context_map: FxHashMap<(SyntaxContext, ExpnId, Transparency), SyntaxContext>expn_data_disambiguators: FxHashMap<Fingerprint, u32>
Expand description

Maps the Fingerprint of an ExpnData to the next disambiguator value. This is used by update_disambiguator to keep track of which ExpnDatas would have collisions without a disambiguator. The keys of this map are always computed with ExpnData.disambiguator set to 0.

Implementations

impl HygieneData[src]

pub(crate) fn new(edition: Edition) -> Self[src]

pub fn with<T, F: FnOnce(&mut HygieneData) -> T>(f: F) -> T[src]

fn fresh_expn(&mut self, expn_data: Option<ExpnData>) -> ExpnId[src]

fn expn_data(&self, expn_id: ExpnId) -> &ExpnData[src]

fn is_descendant_of(&self, expn_id: ExpnId, ancestor: ExpnId) -> bool[src]

fn normalize_to_macros_2_0(&self, ctxt: SyntaxContext) -> SyntaxContext[src]

fn normalize_to_macro_rules(&self, ctxt: SyntaxContext) -> SyntaxContext[src]

fn outer_expn(&self, ctxt: SyntaxContext) -> ExpnId[src]

fn outer_mark(&self, ctxt: SyntaxContext) -> (ExpnId, Transparency)[src]

fn parent_ctxt(&self, ctxt: SyntaxContext) -> SyntaxContext[src]

fn remove_mark(&self, ctxt: &mut SyntaxContext) -> (ExpnId, Transparency)[src]

fn marks(&self, ctxt: SyntaxContext) -> Vec<(ExpnId, Transparency)>ⓘ

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator, 
[src]

fn walk_chain(&self, span: Span, to: SyntaxContext) -> Span[src]

fn adjust(&self, ctxt: &mut SyntaxContext, expn_id: ExpnId) -> Option<ExpnId>[src]

fn apply_mark(
    &mut self,
    ctxt: SyntaxContext,
    expn_id: ExpnId,
    transparency: Transparency
) -> SyntaxContext
[src]

fn apply_mark_internal(
    &mut self,
    ctxt: SyntaxContext,
    expn_id: ExpnId,
    transparency: Transparency
) -> SyntaxContext
[src]

Trait Implementations

impl Debug for HygieneData[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !RefUnwindSafe for HygieneData

impl !Send for HygieneData

impl !Sync for HygieneData

impl Unpin for HygieneData

impl UnwindSafe for HygieneData

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.