about summary refs log tree commit diff
path: root/src/libsyntax/visit.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-03 13:21:03 +0000
committerbors <bors@rust-lang.org>2019-12-03 13:21:03 +0000
commitf577b0ef6e637ab7a6095cdfe0b51fa3faf97050 (patch)
tree3acfc5e36ad8991bf613d5b85e3274c816a8b970 /src/libsyntax/visit.rs
parent7d808659cdc6c979a992fe3db345c0cfb53d973e (diff)
parentbce77980a2611da10b42dbd8a672c8cd17f79a94 (diff)
Auto merge of #66982 - Centril:rollup-yq2281i, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #66148 (Show the sign for signed ops on `exact_div`)
 - #66651 (Add `enclosing scope` parameter to `rustc_on_unimplemented`)
 - #66904 (Adding docs for keyword match, move)
 - #66935 (syntax: Unify macro and attribute arguments in AST)
 - #66941 (Remove `ord` lang item)
 - #66967 (Remove hack for top-level or-patterns in match checking)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax/visit.rs')
-rw-r--r--src/libsyntax/visit.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 5ff337fb60e..4ee09b4b87a 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -841,11 +841,19 @@ pub fn walk_vis<'a, V: Visitor<'a>>(visitor: &mut V, vis: &'a Visibility) {
 
 pub fn walk_attribute<'a, V: Visitor<'a>>(visitor: &mut V, attr: &'a Attribute) {
     match attr.kind {
-        AttrKind::Normal(ref item) => visitor.visit_tts(item.tokens.clone()),
+        AttrKind::Normal(ref item) => walk_mac_args(visitor, &item.args),
         AttrKind::DocComment(_) => {}
     }
 }
 
+pub fn walk_mac_args<'a, V: Visitor<'a>>(visitor: &mut V, args: &'a MacArgs) {
+    match args {
+        MacArgs::Empty => {}
+        MacArgs::Delimited(_dspan, _delim, tokens) => visitor.visit_tts(tokens.clone()),
+        MacArgs::Eq(_eq_span, tokens) => visitor.visit_tts(tokens.clone()),
+    }
+}
+
 pub fn walk_tt<'a, V: Visitor<'a>>(visitor: &mut V, tt: TokenTree) {
     match tt {
         TokenTree::Token(token) => visitor.visit_token(token),