diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-09-26 17:48:16 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-10-07 15:49:53 +1300 |
| commit | 2d3823441fe5324f747f7bf51ffc07b9434f827f (patch) | |
| tree | cf8f7d36282f850bee8aaa73521499fe6f436f85 /src/libsyntax | |
| parent | 59976942eacd26c0cc37247c3ac0c78b97edc6ea (diff) | |
| download | rust-2d3823441fe5324f747f7bf51ffc07b9434f827f.tar.gz rust-2d3823441fe5324f747f7bf51ffc07b9434f827f.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')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/lib.rs | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 5d4a9025827..c3c36d04442 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), @@ -350,6 +351,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); diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index a4271544146..64dedd45923 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -23,7 +23,8 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/master/")] -#![feature(macro_rules, globs, default_type_params, phase)] +#![allow(unknown_features)] +#![feature(macro_rules, globs, default_type_params, phase, slicing_syntax)] #![feature(quote, struct_variant, unsafe_destructor, import_shadowing)] #![allow(deprecated)] |
