diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-27 13:44:40 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-27 16:09:52 -0700 |
| commit | 990202cd0e14421a49734bb463aa323e79066062 (patch) | |
| tree | 0e89ce2ca5bf80dc78de5dfffc00e2736143a3e1 /src/libsyntax | |
| parent | d65fee28d356bf4ca8e95e9ced43db28b6db7246 (diff) | |
| parent | 1639e51f6e4d036478705f4581de3a7417ccec0f (diff) | |
| download | rust-990202cd0e14421a49734bb463aa323e79066062.tar.gz rust-990202cd0e14421a49734bb463aa323e79066062.zip | |
rollup merge of #23794: brson/slicegate
Conflicts: src/test/run-pass/issue-13027.rs
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/lib.rs | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 70f43776ff0..c6e6e749860 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -147,6 +147,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // below (it has to be checked before expansion possibly makes // macros disappear). ("allow_internal_unstable", "1.0.0", Active), + + // #23121. Array patterns have some hazards yet. + ("slice_patterns", "1.0.0", Active), ]; // (changing above list without updating src/doc/reference.md makes @cmr sad) @@ -628,6 +631,11 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { but at the end of a slice (e.g. \ `[0, ..xs, 0]` are experimental") } + ast::PatVec(..) => { + self.gate_feature("slice_patterns", + pattern.span, + "slice pattern syntax is experimental"); + } ast::PatBox(..) => { self.gate_feature("box_patterns", pattern.span, diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 7d6dc3112ad..c471d9e3179 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -39,6 +39,7 @@ #![feature(str_char)] #![feature(convert)] #![feature(into_cow)] +#![feature(slice_patterns)] extern crate arena; extern crate fmt_macros; |
