/// Extract macro use and definition information from the AST node defined
/// by the given NodeId, using the expansion information from the node's
/// span.
///
/// If the span is not macro-generated, do nothing, else use callee and
/// callsite spans to record macro definition and use data, using the
/// mac_uses and mac_defs sets to prevent multiples.
Extract macro use and definition information from the AST node defined
by the given NodeId, using the expansion information from the node's
span.

If the span is not macro-generated, do nothing, else use callee and
callsite spans to record macro definition and use data, using the
mac_uses and mac_defs sets to prevent multiples.
Extract macro use and definition information from the AST node defined by the given NodeId using the expansion information from the node ' s span . If the span is not macro - generated do nothing else use callee and callsite spans to record macro definition and use data using the mac_uses and mac_defs sets to prevent multiples .
fn process_macro_use(&mut self, span: Span, id: NodeId) {
        let data = match self.save_ctxt.get_macro_use_data(span, id) {
            None => return,
            Some(data) => data,
        };
        let mut hasher = SipHasher::new();
        data.callee_span.hash(&mut hasher);
        let hash = hasher.finish();
        let qualname = format!("{}::{}", data.name, hash);
        // Don't write macro definition for imported macros
        if !self.mac_defs.contains(&data.callee_span)
            && !data.imported {
            self.mac_defs.insert(data.callee_span);
            if let Some(sub_span) = self.span.span_for_macro_def_name(data.callee_span) {
                self.dumper.macro_data(MacroData {
                    span: sub_span,
                    name: data.name.clone(),
                    qualname: qualname.clone()
                }.lower(self.tcx));
            }
        }
        if !self.mac_uses.contains(&data.span) {
            self.mac_uses.insert(data.span);
            if let Some(sub_span) = self.span.span_for_macro_use_name(data.span) {
                self.dumper.macro_use(MacroUseData {
                    span: sub_span,
                    name: data.name,
                    qualname: qualname,
                    scope: data.scope,
                    callee_span: data.callee_span,
                    imported: data.imported
                }.lower(self.tcx));
            }
        }
    }
fn process_macro_use ( & mut self , span : Span , id : NodeId ) { let data = match self . save_ctxt . get_macro_use_data ( span , id ) { None => return , Some ( data ) => data , } ; let mut hasher = SipHasher :: new ( ) ; data . callee_span . hash ( & mut hasher ) ; let hash = hasher . finish ( ) ; let qualname = format ! ( " " data name hash ) ; // Don't write macro definition for imported macros if ! self . mac_defs . contains ( & data . callee_span ) && ! data . imported { self . mac_defs . insert ( data . callee_span ) ; if let Some ( sub_span ) = self . span . span_for_macro_def_name ( data . callee_span ) { self . dumper . macro_data ( MacroData { span : sub_span , name : data . name . clone ( ) , qualname : qualname . clone ( ) } . lower ( self . tcx ) ) ; } } if ! self . mac_uses . contains ( & data . span ) { self . mac_uses . insert ( data . span ) ; if let Some ( sub_span ) = self . span . span_for_macro_use_name ( data . span ) { self . dumper . macro_use ( MacroUseData { span : sub_span , name : data . name , qualname : qualname , scope : data . scope , callee_span : data . callee_span , imported : data . imported } . lower ( self . tcx ) ) ; } } }
Extract macro use and definition information from the AST node defined
by the given NodeId, using the expansion information from the node's
span.
Extract macro use and definition information from the AST node defined by the given NodeId using the expansion information from the node ' s span .
&mut self
span
Span
id
NodeId