about summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
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/feature_gate.rs
parent5c45343f11fbf93cf4e15568aee3ff3f2f287466 (diff)
downloadrust-1eaaf440d5173f090d6e937f4b4cffec6c038984.tar.gz
rust-1eaaf440d5173f090d6e937f4b4cffec6c038984.zip
Allow attributes in formal function parameters
Diffstat (limited to 'src/libsyntax/feature_gate.rs')
-rw-r--r--src/libsyntax/feature_gate.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index b41b91c7631..93683074a57 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -560,6 +560,9 @@ declare_features! (
     // Allows the user of associated type bounds.
     (active, associated_type_bounds, "1.34.0", Some(52662), None),
 
+    // Attributes on formal function params
+    (active, param_attrs, "1.36.0", Some(60406), None),
+
     // Allows calling constructor functions in `const fn`
     // FIXME Create issue
     (active, const_constructor, "1.37.0", Some(61456), None),
@@ -2508,6 +2511,18 @@ pub fn check_crate(krate: &ast::Crate,
         parse_sess: sess,
         plugin_attributes,
     };
+
+    sess
+        .param_attr_spans
+        .borrow()
+        .iter()
+        .for_each(|span| gate_feature!(
+            &ctx,
+            param_attrs,
+            *span,
+            "attributes on function parameters are unstable"
+        ));
+
     let visitor = &mut PostExpansionVisitor {
         context: &ctx,
         builtin_attributes: &*BUILTIN_ATTRIBUTE_MAP,