@@ -1067,8 +1067,6 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
1067
1067
fn visit_expr ( & mut self , expr : & mut P < ast:: Expr > ) {
1068
1068
self . cfg . configure_expr ( expr) ;
1069
1069
visit_clobber ( expr. deref_mut ( ) , |mut expr| {
1070
- self . cfg . configure_expr_kind ( & mut expr. kind ) ;
1071
-
1072
1070
if let Some ( attr) = self . take_first_attr ( & mut expr) {
1073
1071
// Collect the invoc regardless of whether or not attributes are permitted here
1074
1072
// expansion will eat the attribute so it won't error later.
@@ -1166,8 +1164,6 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
1166
1164
fn filter_map_expr ( & mut self , expr : P < ast:: Expr > ) -> Option < P < ast:: Expr > > {
1167
1165
let expr = configure ! ( self , expr) ;
1168
1166
expr. filter_map ( |mut expr| {
1169
- self . cfg . configure_expr_kind ( & mut expr. kind ) ;
1170
-
1171
1167
if let Some ( attr) = self . take_first_attr ( & mut expr) {
1172
1168
self . cfg . maybe_emit_expr_attr_err ( & attr. 0 ) ;
1173
1169
@@ -1192,7 +1188,6 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
1192
1188
}
1193
1189
1194
1190
fn visit_pat ( & mut self , pat : & mut P < ast:: Pat > ) {
1195
- self . cfg . configure_pat ( pat) ;
1196
1191
match pat. kind {
1197
1192
PatKind :: MacCall ( _) => { }
1198
1193
_ => return noop_visit_pat ( pat, self ) ,
@@ -1406,15 +1401,12 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
1406
1401
} ) ;
1407
1402
}
1408
1403
1409
- fn visit_foreign_mod ( & mut self , foreign_mod : & mut ast:: ForeignMod ) {
1410
- self . cfg . configure_foreign_mod ( foreign_mod) ;
1411
- noop_visit_foreign_mod ( foreign_mod, self ) ;
1412
- }
1413
-
1414
1404
fn flat_map_foreign_item (
1415
1405
& mut self ,
1416
- mut foreign_item : P < ast:: ForeignItem > ,
1406
+ foreign_item : P < ast:: ForeignItem > ,
1417
1407
) -> SmallVec < [ P < ast:: ForeignItem > ; 1 ] > {
1408
+ let mut foreign_item = configure ! ( self , foreign_item) ;
1409
+
1418
1410
if let Some ( attr) = self . take_first_attr ( & mut foreign_item) {
1419
1411
return self
1420
1412
. collect_attr (
@@ -1439,11 +1431,6 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
1439
1431
}
1440
1432
}
1441
1433
1442
- fn visit_item_kind ( & mut self , item : & mut ast:: ItemKind ) {
1443
- self . cfg . configure_item_kind ( item) ;
1444
- noop_visit_item_kind ( item, self ) ;
1445
- }
1446
-
1447
1434
fn flat_map_generic_param (
1448
1435
& mut self ,
1449
1436
param : ast:: GenericParam ,
@@ -1602,21 +1589,15 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
1602
1589
* id = self . cx . resolver . next_node_id ( )
1603
1590
}
1604
1591
}
1605
-
1606
- fn visit_fn_decl ( & mut self , mut fn_decl : & mut P < ast:: FnDecl > ) {
1607
- self . cfg . configure_fn_decl ( & mut fn_decl) ;
1608
- noop_visit_fn_decl ( fn_decl, self ) ;
1609
- }
1610
1592
}
1611
1593
1612
1594
pub struct ExpansionConfig < ' feat > {
1613
1595
pub crate_name : String ,
1614
1596
pub features : Option < & ' feat Features > ,
1615
1597
pub recursion_limit : Limit ,
1616
1598
pub trace_mac : bool ,
1617
- pub should_test : bool , // If false, strip `#[test]` nodes
1618
- pub keep_macs : bool ,
1619
- pub span_debug : bool , // If true, use verbose debugging for `proc_macro::Span`
1599
+ pub should_test : bool , // If false, strip `#[test]` nodes
1600
+ pub span_debug : bool , // If true, use verbose debugging for `proc_macro::Span`
1620
1601
pub proc_macro_backtrace : bool , // If true, show backtraces for proc-macro panics
1621
1602
}
1622
1603
@@ -1628,7 +1609,6 @@ impl<'feat> ExpansionConfig<'feat> {
1628
1609
recursion_limit : Limit :: new ( 1024 ) ,
1629
1610
trace_mac : false ,
1630
1611
should_test : false ,
1631
- keep_macs : false ,
1632
1612
span_debug : false ,
1633
1613
proc_macro_backtrace : false ,
1634
1614
}
0 commit comments