about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorSeiichi Uchida <seuchida@gmail.com>2018-01-30 19:28:55 +0900
committerflip1995 <uwdkn@student.kit.edu>2018-05-02 11:48:11 +0200
commit6c28f84e37c48faa63488ada95242282cf1a09e9 (patch)
treea10f997856387056201b25ef08963716f3e8022c /src/libsyntax/ext
parent9b3aea602c37d53bbecf8bff8c77ccbfbefc23d0 (diff)
downloadrust-6c28f84e37c48faa63488ada95242282cf1a09e9.tar.gz
rust-6c28f84e37c48faa63488ada95242282cf1a09e9.zip
Gate tool_attributes feature
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/expand.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 1d16a7eb091..41cd9c595d2 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -1017,7 +1017,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
     fn check_attributes(&mut self, attrs: &[ast::Attribute]) {
         let features = self.cx.ecfg.features.unwrap();
         for attr in attrs.iter() {
-            feature_gate::check_attribute(attr, self.cx.parse_sess, features);
+            self.check_attribute_inner(attr, features);
 
             // macros are expanded before any lint passes so this warning has to be hardcoded
             if attr.path == "derive" {
@@ -1030,6 +1030,10 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
 
     fn check_attribute(&mut self, at: &ast::Attribute) {
         let features = self.cx.ecfg.features.unwrap();
+        self.check_attribute_inner(at, features);
+    }
+
+    fn check_attribute_inner(&mut self, at: &ast::Attribute, features: &Features) {
         feature_gate::check_attribute(at, self.cx.parse_sess, features);
     }
 }