Skip to content

Commit 990202c

Browse files
committed
rollup merge of rust-lang#23794: brson/slicegate
Conflicts: src/test/run-pass/issue-13027.rs
2 parents d65fee2 + 1639e51 commit 990202c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+93
-3
lines changed

src/doc/reference.md

Lines changed: 7 additions & 3 deletions

src/doc/trpl/patterns.md

Lines changed: 1 addition & 0 deletions

src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#![feature(step_by)]
4040
#![feature(str_char)]
4141
#![feature(convert)]
42+
#![feature(slice_patterns)]
4243
#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections))]
4344
#![cfg_attr(test, allow(deprecated))] // rand
4445

src/libcoretest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#![feature(debug_builders)]
2727
#![feature(unique)]
2828
#![feature(step_by)]
29+
#![feature(slice_patterns)]
2930
#![allow(deprecated)] // rand
3031

3132
extern crate core;

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#![feature(str_char)]
4444
#![feature(convert)]
4545
#![feature(into_cow)]
46+
#![feature(slice_patterns)]
4647
#![cfg_attr(test, feature(test))]
4748

4849
#![allow(trivial_casts)]

src/librustdoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#![feature(path_ext)]
3838
#![feature(path_relative_from)]
3939
#![feature(convert)]
40+
#![feature(slice_patterns)]
4041

4142
extern crate arena;
4243
extern crate getopts;

src/libstd/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
#![feature(allow_internal_unstable)]
127127
#![feature(str_char)]
128128
#![feature(into_cow)]
129+
#![feature(slice_patterns)]
129130
#![cfg_attr(test, feature(test, rustc_private, std_misc))]
130131

131132
// Don't link to std. We are std.

src/libsyntax/feature_gate.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
147147
// below (it has to be checked before expansion possibly makes
148148
// macros disappear).
149149
("allow_internal_unstable", "1.0.0", Active),
150+
151+
// #23121. Array patterns have some hazards yet.
152+
("slice_patterns", "1.0.0", Active),
150153
];
151154
// (changing above list without updating src/doc/reference.md makes @cmr sad)
152155

@@ -628,6 +631,11 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
628631
but at the end of a slice (e.g. \
629632
`[0, ..xs, 0]` are experimental")
630633
}
634+
ast::PatVec(..) => {
635+
self.gate_feature("slice_patterns",
636+
pattern.span,
637+
"slice pattern syntax is experimental");
638+
}
631639
ast::PatBox(..) => {
632640
self.gate_feature("box_patterns",
633641
pattern.span,

src/libsyntax/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#![feature(str_char)]
4040
#![feature(convert)]
4141
#![feature(into_cow)]
42+
#![feature(slice_patterns)]
4243

4344
extern crate arena;
4445
extern crate fmt_macros;

src/test/auxiliary/roman_numerals.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#![crate_type="dylib"]
1414
#![feature(plugin_registrar, rustc_private)]
15+
#![feature(slice_patterns)]
1516

1617
extern crate syntax;
1718
extern crate rustc;

0 commit comments

Comments
 (0)