about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-06-19 17:34:36 +0200
committerGitHub <noreply@github.com>2019-06-19 17:34:36 +0200
commit7b3984b21b3ca526d6452f39334d4a4ca2234ba9 (patch)
tree089f5cc0159c79ac7003b09772d94e687e5e174f /src/libsyntax/ext
parent564326a6268d199c1b3c3d67d270c708da7b30ec (diff)
parent0b58bb32f66f4ec5f00683293093d94d8fb1aada (diff)
downloadrust-7b3984b21b3ca526d6452f39334d4a4ca2234ba9.tar.gz
rust-7b3984b21b3ca526d6452f39334d4a4ca2234ba9.zip
Rollup merge of #61547 - petrochenkov:cfgen, r=Centril
Support `cfg` and `cfg_attr` on generic parameters

`cfg` attributes are supported in all other positions where attributes are accepted at all.

They were previously prohibited in https://github.com/rust-lang/rust/pull/51283 because they weren't implemented correctly before that and were simply ignored.
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/expand.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index be90def0bdd..cfd67575b6f 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -1329,9 +1329,9 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
         }
     }
 
-    fn visit_generic_param(&mut self, param: &mut ast::GenericParam) {
-        self.cfg.disallow_cfg_on_generic_param(&param);
-        noop_visit_generic_param(param, self)
+    fn visit_generic_params(&mut self, params: &mut Vec<ast::GenericParam>) {
+        self.cfg.configure_generic_params(params);
+        noop_visit_generic_params(params, self);
     }
 
     fn visit_attribute(&mut self, at: &mut ast::Attribute) {