about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorCaio <c410.f3r@gmail.com>2019-06-09 07:58:40 -0300
committerCaio <c410.f3r@gmail.com>2019-06-09 07:58:40 -0300
commit1eaaf440d5173f090d6e937f4b4cffec6c038984 (patch)
tree9f0beed7bc92e5815b4db44b8e32973678140fcc /src/libsyntax/ext
parent5c45343f11fbf93cf4e15568aee3ff3f2f287466 (diff)
downloadrust-1eaaf440d5173f090d6e937f4b4cffec6c038984.tar.gz
rust-1eaaf440d5173f090d6e937f4b4cffec6c038984.zip
Allow attributes in formal function parameters
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/build.rs5
-rw-r--r--src/libsyntax/ext/expand.rs5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs
index 2a03e49996b..9d4bf7d518d 100644
--- a/src/libsyntax/ext/build.rs
+++ b/src/libsyntax/ext/build.rs
@@ -963,9 +963,10 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
     fn arg(&self, span: Span, ident: ast::Ident, ty: P<ast::Ty>) -> ast::Arg {
         let arg_pat = self.pat_ident(span, ident);
         ast::Arg {
-            ty,
+            attrs: ThinVec::default(),
+            id: ast::DUMMY_NODE_ID,
             pat: arg_pat,
-            id: ast::DUMMY_NODE_ID
+            ty,
         }
     }
 
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 99605395553..671c01c53bb 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -1616,6 +1616,11 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
             *id = self.cx.resolver.next_node_id()
         }
     }
+
+    fn visit_fn_decl(&mut self, mut fn_decl: &mut P<ast::FnDecl>) {
+        self.cfg.configure_fn_decl(&mut fn_decl);
+        noop_visit_fn_decl(fn_decl, self);
+    }
 }
 
 pub struct ExpansionConfig<'feat> {