Struct rustc_expand::expand::MacroExpander [−][src]
Fields
cx: &'a mut ExtCtxt<'b>monotonic: boolImplementations
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]
&mut self,
input_fragment: AstFragment
) -> AstFragment
fn resolve_imports(&mut self)[src]
fn collect_invocations(
&mut self,
fragment: AstFragment,
extra_placeholders: &[NodeId]
) -> (AstFragment, Vec<(Invocation, Option<Lrc<SyntaxExtension>>)>)[src]
&mut self,
fragment: AstFragment,
extra_placeholders: &[NodeId]
) -> (AstFragment, Vec<(Invocation, Option<Lrc<SyntaxExtension>>)>)
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.
fn error_recursion_limit_reached(&mut self)[src]
fn error_wrong_fragment_kind(
&mut self,
kind: AstFragmentKind,
mac: &MacCall,
span: Span
)[src]
&mut self,
kind: AstFragmentKind,
mac: &MacCall,
span: Span
)
A macro’s expansion does not fit in this fragment kind. For example, a non-type macro in a type position.
fn expand_invoc(
&mut self,
invoc: Invocation,
ext: &SyntaxExtensionKind
) -> ExpandResult<AstFragment, Invocation>[src]
&mut self,
invoc: Invocation,
ext: &SyntaxExtensionKind
) -> ExpandResult<AstFragment, Invocation>
fn gate_proc_macro_attr_item(&self, span: Span, item: &Annotatable)[src]
fn gate_proc_macro_input(&self, annotatable: &Annotatable)[src]
fn parse_ast_fragment(
&mut self,
toks: TokenStream,
kind: AstFragmentKind,
path: &Path,
span: Span
) -> AstFragment[src]
&mut self,
toks: TokenStream,
kind: AstFragmentKind,
path: &Path,
span: Span
) -> AstFragment
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,
'b: 'a,
impl<'a, 'b> !UnwindSafe for MacroExpander<'a, 'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,