about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2015-01-21 18:21:14 -0800
committerBrian Anderson <banderson@mozilla.com>2015-01-22 13:47:56 -0800
commitd3c0bb416e78cb878182dc6f4fd4a09922db87c1 (patch)
tree4674a6520229b74dfcffc2b41da2b1ee1e248447 /src/libsyntax/feature_gate.rs
parent2b879a08b503f3ea45e7206c6bcd47d966603598 (diff)
downloadrust-d3c0bb416e78cb878182dc6f4fd4a09922db87c1.tar.gz
rust-d3c0bb416e78cb878182dc6f4fd4a09922db87c1.zip
Put #[staged_api] behind the 'staged_api' gate
Diffstat (limited to 'src/libsyntax/feature_gate.rs')
-rw-r--r--src/libsyntax/feature_gate.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 43af53aa2d2..989126cd8d6 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -113,6 +113,9 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
     // mean anything
     ("test_accepted_feature", "1.0.0", Accepted),
     ("test_removed_feature", "1.0.0", Removed),
+
+    // Allows use of #[staged_api]
+    ("staged_api", "1.0.0", Active),
 ];
 
 enum Status {
@@ -444,6 +447,11 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
     }
 
     fn visit_attribute(&mut self, attr: &ast::Attribute) {
+        if attr.check_name("staged_api") {
+            self.gate_feature("staged_api", attr.span,
+                              "staged_api is for use by rustc only");
+        }
+
         if attr::contains_name(slice::ref_slice(attr), "lang") {
             self.gate_feature("lang_items",
                               attr.span,