@@ -115,23 +115,18 @@ impl<'a> base::Resolver for Resolver<'a> {
115115 } ) ;
116116 }
117117
118+
119+
118120 fn visit_ast_fragment_with_placeholders (
119121 & mut self , expansion : ExpnId , fragment : & AstFragment , derives : & [ ExpnId ]
120122 ) {
121- // Fill in some data for derives if the fragment is from a derive container .
123+ // Integrate the new AST fragment into all the definition and module structures .
122124 // We are inside the `expansion` now, but other parent scope components are still the same.
123125 let parent_scope = ParentScope { expansion, ..self . invocation_parent_scopes [ & expansion] } ;
124- let parent_def = self . definitions . invocation_parent ( expansion) ;
125- self . invocation_parent_scopes . extend ( derives. iter ( ) . map ( |& derive| ( derive, parent_scope) ) ) ;
126- for & derive_invoc_id in derives {
127- self . definitions . set_invocation_parent ( derive_invoc_id, parent_def) ;
128- }
129- parent_scope. module . unresolved_invocations . borrow_mut ( ) . remove ( & expansion) ;
130- parent_scope. module . unresolved_invocations . borrow_mut ( ) . extend ( derives) ;
131-
132- // Integrate the new AST fragment into all the definition and module structures.
133- let output_legacy_scope = self . build_reduced_graph ( fragment, parent_scope) ;
126+ let output_legacy_scope = self . build_reduced_graph ( fragment, derives, parent_scope) ;
134127 self . output_legacy_scopes . insert ( expansion, output_legacy_scope) ;
128+
129+ parent_scope. module . unresolved_invocations . borrow_mut ( ) . remove ( & expansion) ;
135130 }
136131
137132 fn register_builtin_macro ( & mut self , ident : ast:: Ident , ext : SyntaxExtension ) {
0 commit comments