@@ -176,13 +176,8 @@ pub trait Visitor<'ast>: Sized {
176176 fn visit_lifetime ( & mut self , lifetime : & ' ast Lifetime ) {
177177 walk_lifetime ( self , lifetime)
178178 }
179- fn visit_mac ( & mut self , _mac : & ' ast MacCall ) {
180- panic ! ( "visit_mac disabled by default" ) ;
181- // N.B., see note about macros above.
182- // if you really want a visitor that
183- // works on macros, use this
184- // definition in your trait impl:
185- // visit::walk_mac(self, _mac)
179+ fn visit_mac_call ( & mut self , mac : & ' ast MacCall ) {
180+ walk_mac ( self , mac)
186181 }
187182 fn visit_mac_def ( & mut self , _mac : & ' ast MacroDef , _id : NodeId ) {
188183 // Nothing to do
@@ -346,7 +341,7 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
346341 visitor. visit_generics ( generics) ;
347342 walk_list ! ( visitor, visit_param_bound, bounds) ;
348343 }
349- ItemKind :: MacCall ( ref mac) => visitor. visit_mac ( mac) ,
344+ ItemKind :: MacCall ( ref mac) => visitor. visit_mac_call ( mac) ,
350345 ItemKind :: MacroDef ( ref ts) => visitor. visit_mac_def ( ts, item. id ) ,
351346 }
352347 walk_list ! ( visitor, visit_attribute, & item. attrs) ;
@@ -414,7 +409,7 @@ pub fn walk_ty<'a, V: Visitor<'a>>(visitor: &mut V, typ: &'a Ty) {
414409 }
415410 TyKind :: Typeof ( ref expression) => visitor. visit_anon_const ( expression) ,
416411 TyKind :: Infer | TyKind :: ImplicitSelf | TyKind :: Err => { }
417- TyKind :: MacCall ( ref mac) => visitor. visit_mac ( mac) ,
412+ TyKind :: MacCall ( ref mac) => visitor. visit_mac_call ( mac) ,
418413 TyKind :: Never | TyKind :: CVarArgs => { }
419414 }
420415}
@@ -532,7 +527,7 @@ pub fn walk_pat<'a, V: Visitor<'a>>(visitor: &mut V, pattern: &'a Pat) {
532527 PatKind :: Tuple ( ref elems) | PatKind :: Slice ( ref elems) | PatKind :: Or ( ref elems) => {
533528 walk_list ! ( visitor, visit_pat, elems) ;
534529 }
535- PatKind :: MacCall ( ref mac) => visitor. visit_mac ( mac) ,
530+ PatKind :: MacCall ( ref mac) => visitor. visit_mac_call ( mac) ,
536531 }
537532}
538533
@@ -557,7 +552,7 @@ pub fn walk_foreign_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a ForeignI
557552 walk_list ! ( visitor, visit_ty, ty) ;
558553 }
559554 ForeignItemKind :: MacCall ( mac) => {
560- visitor. visit_mac ( mac) ;
555+ visitor. visit_mac_call ( mac) ;
561556 }
562557 }
563558}
@@ -662,7 +657,7 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a AssocItem,
662657 walk_list ! ( visitor, visit_ty, ty) ;
663658 }
664659 AssocItemKind :: MacCall ( mac) => {
665- visitor. visit_mac ( mac) ;
660+ visitor. visit_mac_call ( mac) ;
666661 }
667662 }
668663}
@@ -692,7 +687,7 @@ pub fn walk_stmt<'a, V: Visitor<'a>>(visitor: &mut V, statement: &'a Stmt) {
692687 StmtKind :: Empty => { }
693688 StmtKind :: MacCall ( ref mac) => {
694689 let MacCallStmt { ref mac, style : _, ref attrs } = * * mac;
695- visitor. visit_mac ( mac) ;
690+ visitor. visit_mac_call ( mac) ;
696691 for attr in attrs. iter ( ) {
697692 visitor. visit_attribute ( attr) ;
698693 }
@@ -823,7 +818,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
823818 ExprKind :: Ret ( ref optional_expression) => {
824819 walk_list ! ( visitor, visit_expr, optional_expression) ;
825820 }
826- ExprKind :: MacCall ( ref mac) => visitor. visit_mac ( mac) ,
821+ ExprKind :: MacCall ( ref mac) => visitor. visit_mac_call ( mac) ,
827822 ExprKind :: Paren ( ref subexpression) => visitor. visit_expr ( subexpression) ,
828823 ExprKind :: InlineAsm ( ref ia) => {
829824 for ( op, _) in & ia. operands {
0 commit comments