summary refs log tree commit diff
path: root/src/libsyntax/feature_gate.rs
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-09-26 17:48:16 +1200
committerNick Cameron <ncameron@mozilla.com>2014-10-02 13:23:36 +1300
commit95cfc35607ccf5f02f02de56a35a9ef50fa23a82 (patch)
tree85cb0f79ec42469ac7203cdcc09ffee5247cded7 /src/libsyntax/feature_gate.rs
parentdf2f1fa7680a86ba228f004e7de731e91a1df1fe (diff)
downloadrust-95cfc35607ccf5f02f02de56a35a9ef50fa23a82.tar.gz
rust-95cfc35607ccf5f02f02de56a35a9ef50fa23a82.zip
Put slicing syntax behind a feature gate.
[breaking-change]

If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
Diffstat (limited to 'src/libsyntax/feature_gate.rs')
-rw-r--r--src/libsyntax/feature_gate.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index ca6d488772c..38de2a9c284 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -70,6 +70,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
     ("tuple_indexing", Active),
     ("associated_types", Active),
     ("visible_private_types", Active),
+    ("slicing_syntax", Active),
 
     ("if_let", Active),
 
@@ -362,6 +363,11 @@ impl<'a, 'v> Visitor<'v> for Context<'a> {
                 self.gate_feature("if_let", e.span,
                                   "`if let` syntax is experimental");
             }
+            ast::ExprSlice(..) => {
+                self.gate_feature("slicing_syntax",
+                                  e.span,
+                                  "slicing syntax is experimental");
+            }
             _ => {}
         }
         visit::walk_expr(self, e);