@@ -23,7 +23,7 @@ use syntax::attr::{self, HasAttrs};
23
23
use syntax:: errors:: DiagnosticBuilder ;
24
24
use syntax:: ext:: base:: { self , Annotatable , Determinacy , MultiModifier , MultiDecorator } ;
25
25
use 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 } ;
27
27
use syntax:: ext:: hygiene:: { self , Mark , Transparency } ;
28
28
use syntax:: ext:: placeholders:: placeholder;
29
29
use syntax:: ext:: tt:: macro_rules;
@@ -187,9 +187,10 @@ impl<'a> base::Resolver for Resolver<'a> {
187
187
self . whitelisted_legacy_custom_derives . contains ( & name)
188
188
}
189
189
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 ] ) {
191
192
let invocation = self . invocations [ & mark] ;
192
- self . collect_def_ids ( mark, invocation, expansion ) ;
193
+ self . collect_def_ids ( mark, invocation, fragment ) ;
193
194
194
195
self . current_module = invocation. module . get ( ) ;
195
196
self . current_module . unresolved_invocations . borrow_mut ( ) . remove ( & mark) ;
@@ -202,7 +203,7 @@ impl<'a> base::Resolver for Resolver<'a> {
202
203
legacy_scope : LegacyScope :: Invocation ( invocation) ,
203
204
expansion : mark,
204
205
} ;
205
- expansion . visit_with ( & mut visitor) ;
206
+ fragment . visit_with ( & mut visitor) ;
206
207
invocation. expansion . set ( visitor. legacy_scope ) ;
207
208
}
208
209
@@ -396,14 +397,14 @@ impl<'a> Resolver<'a> {
396
397
Ok ( ext) => if let SyntaxExtension :: ProcMacroDerive ( _, ref inert_attrs, _) = * ext {
397
398
if inert_attrs. contains ( & attr_name) {
398
399
// 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 )
400
401
. make_items ( ) . pop ( ) . unwrap ( ) ;
401
402
let dummy_item = Annotatable :: Item ( dummy_item) ;
402
403
* item = mem:: replace ( item, dummy_item) . map_attrs ( |mut attrs| {
403
404
let inert_attr = attr. take ( ) . unwrap ( ) ;
404
405
attr:: mark_known ( & inert_attr) ;
405
406
if self . proc_macro_enabled {
406
- * attr = find_attr_invoc ( & mut attrs) ;
407
+ * attr = expand :: find_attr_invoc ( & mut attrs) ;
407
408
}
408
409
attrs. push ( inert_attr) ;
409
410
attrs
@@ -769,7 +770,7 @@ impl<'a> Resolver<'a> {
769
770
fn collect_def_ids ( & mut self ,
770
771
mark : Mark ,
771
772
invocation : & ' a InvocationData < ' a > ,
772
- expansion : & Expansion ) {
773
+ fragment : & AstFragment ) {
773
774
let Resolver { ref mut invocations, arenas, graph_root, .. } = * self ;
774
775
let InvocationData { def_index, .. } = * invocation;
775
776
@@ -787,7 +788,7 @@ impl<'a> Resolver<'a> {
787
788
let mut def_collector = DefCollector :: new ( & mut self . definitions , mark) ;
788
789
def_collector. visit_macro_invoc = Some ( visit_macro_invoc) ;
789
790
def_collector. with_parent ( def_index, |def_collector| {
790
- expansion . visit_with ( def_collector)
791
+ fragment . visit_with ( def_collector)
791
792
} ) ;
792
793
}
793
794
0 commit comments