@@ -23,7 +23,7 @@ use syntax::attr::{self, HasAttrs};
2323use syntax:: errors:: DiagnosticBuilder ;
2424use syntax:: ext:: base:: { self , Annotatable , Determinacy , MultiModifier , MultiDecorator } ;
2525use syntax:: ext:: base:: { MacroKind , SyntaxExtension , Resolver as SyntaxResolver } ;
26- use syntax:: ext:: expand:: { Expansion , ExpansionKind , Invocation , InvocationKind , find_attr_invoc } ;
26+ use syntax:: ext:: expand:: { self , AstFragment , AstFragmentKind , Invocation , InvocationKind } ;
2727use syntax:: ext:: hygiene:: { self , Mark , Transparency } ;
2828use syntax:: ext:: placeholders:: placeholder;
2929use syntax:: ext:: tt:: macro_rules;
@@ -187,9 +187,10 @@ impl<'a> base::Resolver for Resolver<'a> {
187187 self . whitelisted_legacy_custom_derives . contains ( & name)
188188 }
189189
190- fn visit_expansion ( & mut self , mark : Mark , expansion : & Expansion , derives : & [ Mark ] ) {
190+ fn visit_ast_fragment_with_placeholders ( & mut self , mark : Mark , fragment : & AstFragment ,
191+ derives : & [ Mark ] ) {
191192 let invocation = self . invocations [ & mark] ;
192- self . collect_def_ids ( mark, invocation, expansion ) ;
193+ self . collect_def_ids ( mark, invocation, fragment ) ;
193194
194195 self . current_module = invocation. module . get ( ) ;
195196 self . current_module . unresolved_invocations . borrow_mut ( ) . remove ( & mark) ;
@@ -202,7 +203,7 @@ impl<'a> base::Resolver for Resolver<'a> {
202203 legacy_scope : LegacyScope :: Invocation ( invocation) ,
203204 expansion : mark,
204205 } ;
205- expansion . visit_with ( & mut visitor) ;
206+ fragment . visit_with ( & mut visitor) ;
206207 invocation. expansion . set ( visitor. legacy_scope ) ;
207208 }
208209
@@ -396,14 +397,14 @@ impl<'a> Resolver<'a> {
396397 Ok ( ext) => if let SyntaxExtension :: ProcMacroDerive ( _, ref inert_attrs, _) = * ext {
397398 if inert_attrs. contains ( & attr_name) {
398399 // FIXME(jseyfried) Avoid `mem::replace` here.
399- let dummy_item = placeholder ( ExpansionKind :: Items , ast:: DUMMY_NODE_ID )
400+ let dummy_item = placeholder ( AstFragmentKind :: Items , ast:: DUMMY_NODE_ID )
400401 . make_items ( ) . pop ( ) . unwrap ( ) ;
401402 let dummy_item = Annotatable :: Item ( dummy_item) ;
402403 * item = mem:: replace ( item, dummy_item) . map_attrs ( |mut attrs| {
403404 let inert_attr = attr. take ( ) . unwrap ( ) ;
404405 attr:: mark_known ( & inert_attr) ;
405406 if self . proc_macro_enabled {
406- * attr = find_attr_invoc ( & mut attrs) ;
407+ * attr = expand :: find_attr_invoc ( & mut attrs) ;
407408 }
408409 attrs. push ( inert_attr) ;
409410 attrs
@@ -769,7 +770,7 @@ impl<'a> Resolver<'a> {
769770 fn collect_def_ids ( & mut self ,
770771 mark : Mark ,
771772 invocation : & ' a InvocationData < ' a > ,
772- expansion : & Expansion ) {
773+ fragment : & AstFragment ) {
773774 let Resolver { ref mut invocations, arenas, graph_root, .. } = * self ;
774775 let InvocationData { def_index, .. } = * invocation;
775776
@@ -787,7 +788,7 @@ impl<'a> Resolver<'a> {
787788 let mut def_collector = DefCollector :: new ( & mut self . definitions , mark) ;
788789 def_collector. visit_macro_invoc = Some ( visit_macro_invoc) ;
789790 def_collector. with_parent ( def_index, |def_collector| {
790- expansion . visit_with ( def_collector)
791+ fragment . visit_with ( def_collector)
791792 } ) ;
792793 }
793794
0 commit comments