[−][src]Struct rustc_expand::expand::MacroExpander

pub struct MacroExpander<'a, 'b> {
    pub cx: &'a mut ExtCtxt<'b>,
    monotonic: bool,
}

Fields

cx: &'a mut ExtCtxt<'b>monotonic: bool

Implementations

impl<'a, 'b> MacroExpander<'a, 'b>[src]

pub fn new(cx: &'a mut ExtCtxt<'b>, monotonic: bool) -> Self[src]

pub fn expand_crate(&mut self, krate: Crate) -> Crate[src]

pub fn fully_expand_fragment(
    &mut self,
    input_fragment: AstFragment
) -> AstFragment
[src]

pub(in expand) fn error_derive_forbidden_on_non_adt(
    &self,
    derives: &[Path],
    item: &Annotatable
)
[src]

pub(in expand) fn resolve_imports(
    &mut self
)
[src]

pub(in expand) fn collect_invocations(
    &mut self,
    fragment: AstFragment,
    extra_placeholders: &[NodeId]
) -> (AstFragment, Vec<(Invocation, Option<InvocationRes>)>)
[src]

Collects all macro invocations reachable at this time in this AST fragment, and replace them with "placeholders" - dummy macro invocations with specially crafted NodeIds. Then call into resolver that builds a skeleton ("reduced graph") of the fragment and prepares data for resolving paths of macro invocations.

pub(in expand) fn error_recursion_limit_reached(
    &mut self
)
[src]

pub(in expand) fn error_wrong_fragment_kind(
    &mut self,
    kind: AstFragmentKind,
    mac: &MacCall,
    span: Span
)
[src]

A macro's expansion does not fit in this fragment kind. For example, a non-type macro in a type position.

pub(in expand) fn expand_invoc(
    &mut self,
    invoc: Invocation,
    ext: &SyntaxExtensionKind
) -> ExpandResult<AstFragment, Invocation>
[src]

pub(in expand) fn gate_proc_macro_attr_item(
    &self,
    span: Span,
    item: &Annotatable
)
[src]

pub(in expand) fn gate_proc_macro_input(
    &self,
    annotatable: &Annotatable
)
[src]

pub(in expand) fn parse_ast_fragment(
    &mut self,
    toks: TokenStream,
    kind: AstFragmentKind,
    path: &Path,
    span: Span
) -> AstFragment
[src]

Auto Trait Implementations

impl<'a, 'b> !RefUnwindSafe for MacroExpander<'a, 'b>

impl<'a, 'b> !Send for MacroExpander<'a, 'b>

impl<'a, 'b> !Sync for MacroExpander<'a, 'b>

impl<'a, 'b> Unpin for MacroExpander<'a, 'b> where
    'b: 'a, 

impl<'a, 'b> !UnwindSafe for MacroExpander<'a, 'b>

Blanket Implementations

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

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

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

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

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

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.

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.