fn collect_invocations(
        &mut self,
        mut fragment: AstFragment,
        extra_placeholders: &[NodeId],
    ) -> (AstFragment, Vec<(Invocation, Option<InvocationRes>)>) {
        // Resolve `$crate`s in the fragment for pretty-printing.
        self.cx.resolver.resolve_dollar_crates();

        let invocations = {
            let mut collector = InvocationCollector {
                cfg: StripUnconfigured { sess: &self.cx.sess, features: self.cx.ecfg.features },
                cx: self.cx,
                invocations: Vec::new(),
                monotonic: self.monotonic,
            };
            fragment.mut_visit_with(&mut collector);
            fragment.add_placeholders(extra_placeholders);
            collector.invocations
        };

        if self.monotonic {
            self.cx
                .resolver
                .visit_ast_fragment_with_placeholders(self.cx.current_expansion.id, &fragment);
        }

        (fragment, invocations)
    }
/// Collects all macro invocations reachable at this time in this AST fragment, and replace
/// them with "placeholders" - dummy macro invocations with specially crafted `NodeId`s.
/// Then call into resolver that builds a skeleton ("reduced graph") of the fragment and
/// prepares data for resolving paths of macro invocations.
Collects all macro invocations reachable at this time in this AST fragment, and replace
them with "placeholders" - dummy macro invocations with specially crafted `NodeId`s.
Then call into resolver that builds a skeleton ("reduced graph") of the fragment and
prepares data for resolving paths of macro invocations.
Collects all macro invocations reachable at this time in this AST fragment and replace them with " placeholders " - dummy macro invocations with specially crafted ` NodeId ` s . Then call into resolver that builds a skeleton ( " reduced graph " ) of the fragment and prepares data for resolving paths of macro invocations .
fn collect_invocations(
        &mut self,
        mut fragment: AstFragment,
        extra_placeholders: &[NodeId],
    ) -> (AstFragment, Vec<(Invocation, Option<InvocationRes>)>) {
        // Resolve `$crate`s in the fragment for pretty-printing.
        self.cx.resolver.resolve_dollar_crates();
        let invocations = {
            let mut collector = InvocationCollector {
                cfg: StripUnconfigured { sess: &self.cx.sess, features: self.cx.ecfg.features },
                cx: self.cx,
                invocations: Vec::new(),
                monotonic: self.monotonic,
            };
            fragment.mut_visit_with(&mut collector);
            fragment.add_placeholders(extra_placeholders);
            collector.invocations
        };
        if self.monotonic {
            self.cx
                .resolver
                .visit_ast_fragment_with_placeholders(self.cx.current_expansion.id, &fragment);
        }
        (fragment, invocations)
    }
fn collect_invocations ( & mut self , mut fragment : AstFragment , extra_placeholders : & [ NodeId ] , ) -> ( AstFragment , Vec < ( Invocation , Option < InvocationRes > ) > ) { // Resolve `$crate`s in the fragment for pretty-printing. self . cx . resolver . resolve_dollar_crates ( ) ; let invocations = { let mut collector = InvocationCollector { cfg : StripUnconfigured { sess : & self . cx . sess , features : self . cx . ecfg . features } , cx : self . cx , invocations : Vec :: new ( ) , monotonic : self . monotonic , } ; fragment . mut_visit_with ( & mut collector ) ; fragment . add_placeholders ( extra_placeholders ) ; collector . invocations } ; if self . monotonic { self . cx . resolver . visit_ast_fragment_with_placeholders ( self . cx . current_expansion . id , & fragment ) ; } ( fragment , invocations ) }
Collects all macro invocations reachable at this time in this AST fragment, and replace
them with "placeholders" - dummy macro invocations with specially crafted `NodeId`s.
Collects all macro invocations reachable at this time in this AST fragment and replace them with " placeholders " - dummy macro invocations with specially crafted ` NodeId ` s .
&mut self
fragment
AstFragment
extra_placeholders
&[NodeId]
&mut self
fragment
AstFragment
extra_placeholders
&[NodeId]