Feature gate *all* slice patterns. #23121
Until some backwards-compatibility hazards are fixed in #23121, these need to be unstable. [breaking-change]
This commit is contained in:
parent
199bdcfeff
commit
1639e51f6e
51 changed files with 93 additions and 3 deletions
|
@ -2408,9 +2408,13 @@ considered off, and using the features will result in a compiler error.
|
||||||
|
|
||||||
The currently implemented features of the reference compiler are:
|
The currently implemented features of the reference compiler are:
|
||||||
|
|
||||||
* `advanced_slice_patterns` - see the [match expressions](#match-expressions)
|
* `advanced_slice_patterns` - See the [match expressions](#match-expressions)
|
||||||
section for discussion; the exact semantics of
|
section for discussion; the exact semantics of
|
||||||
slice patterns are subject to change.
|
slice patterns are subject to change, so some types
|
||||||
|
are still unstable.
|
||||||
|
|
||||||
|
* `slice_patterns` - OK, actually, slice patterns are just scary and
|
||||||
|
completely unstable.
|
||||||
|
|
||||||
* `asm` - The `asm!` macro provides a means for inline assembly. This is often
|
* `asm` - The `asm!` macro provides a means for inline assembly. This is often
|
||||||
useful, but the exact syntax for this feature along with its
|
useful, but the exact syntax for this feature along with its
|
||||||
|
@ -3329,7 +3333,7 @@ array, like `[.., 42, ..]`. If preceded by a variable name, it will bind the
|
||||||
corresponding slice to the variable. Example:
|
corresponding slice to the variable. Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
# #![feature(advanced_slice_patterns)]
|
# #![feature(advanced_slice_patterns, slice_patterns)]
|
||||||
fn is_symmetric(list: &[u32]) -> bool {
|
fn is_symmetric(list: &[u32]) -> bool {
|
||||||
match list {
|
match list {
|
||||||
[] | [_] => true,
|
[] | [_] => true,
|
||||||
|
|
|
@ -177,6 +177,7 @@ match origin {
|
||||||
If you want to match against a slice or array, you can use `&`:
|
If you want to match against a slice or array, you can use `&`:
|
||||||
|
|
||||||
```{rust}
|
```{rust}
|
||||||
|
# #![feature(slice_patterns)]
|
||||||
fn main() {
|
fn main() {
|
||||||
let v = vec!["match_this", "1"];
|
let v = vec!["match_this", "1"];
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#![feature(step_by)]
|
#![feature(step_by)]
|
||||||
#![feature(str_char)]
|
#![feature(str_char)]
|
||||||
#![feature(convert)]
|
#![feature(convert)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections))]
|
#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections))]
|
||||||
#![cfg_attr(test, allow(deprecated))] // rand
|
#![cfg_attr(test, allow(deprecated))] // rand
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#![feature(debug_builders)]
|
#![feature(debug_builders)]
|
||||||
#![feature(unique)]
|
#![feature(unique)]
|
||||||
#![feature(step_by)]
|
#![feature(step_by)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
#![allow(deprecated)] // rand
|
#![allow(deprecated)] // rand
|
||||||
|
|
||||||
extern crate core;
|
extern crate core;
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#![feature(str_char)]
|
#![feature(str_char)]
|
||||||
#![feature(convert)]
|
#![feature(convert)]
|
||||||
#![feature(into_cow)]
|
#![feature(into_cow)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
#![cfg_attr(test, feature(test))]
|
#![cfg_attr(test, feature(test))]
|
||||||
|
|
||||||
#![allow(trivial_casts)]
|
#![allow(trivial_casts)]
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#![feature(path_ext)]
|
#![feature(path_ext)]
|
||||||
#![feature(path_relative_from)]
|
#![feature(path_relative_from)]
|
||||||
#![feature(convert)]
|
#![feature(convert)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
extern crate arena;
|
extern crate arena;
|
||||||
extern crate getopts;
|
extern crate getopts;
|
||||||
|
|
|
@ -129,6 +129,7 @@
|
||||||
#![feature(allow_internal_unstable)]
|
#![feature(allow_internal_unstable)]
|
||||||
#![feature(str_char)]
|
#![feature(str_char)]
|
||||||
#![feature(into_cow)]
|
#![feature(into_cow)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
#![cfg_attr(test, feature(test, rustc_private, std_misc))]
|
#![cfg_attr(test, feature(test, rustc_private, std_misc))]
|
||||||
|
|
||||||
// Don't link to std. We are std.
|
// Don't link to std. We are std.
|
||||||
|
|
|
@ -153,6 +153,9 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
|
||||||
// below (it has to be checked before expansion possibly makes
|
// below (it has to be checked before expansion possibly makes
|
||||||
// macros disappear).
|
// macros disappear).
|
||||||
("allow_internal_unstable", "1.0.0", Active),
|
("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)
|
// (changing above list without updating src/doc/reference.md makes @cmr sad)
|
||||||
|
|
||||||
|
@ -694,6 +697,11 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
||||||
but at the end of a slice (e.g. \
|
but at the end of a slice (e.g. \
|
||||||
`[0, ..xs, 0]` are experimental")
|
`[0, ..xs, 0]` are experimental")
|
||||||
}
|
}
|
||||||
|
ast::PatVec(..) => {
|
||||||
|
self.gate_feature("slice_patterns",
|
||||||
|
pattern.span,
|
||||||
|
"slice pattern syntax is experimental");
|
||||||
|
}
|
||||||
ast::PatBox(..) => {
|
ast::PatBox(..) => {
|
||||||
self.gate_feature("box_patterns",
|
self.gate_feature("box_patterns",
|
||||||
pattern.span,
|
pattern.span,
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#![feature(str_char)]
|
#![feature(str_char)]
|
||||||
#![feature(convert)]
|
#![feature(convert)]
|
||||||
#![feature(into_cow)]
|
#![feature(into_cow)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
extern crate arena;
|
extern crate arena;
|
||||||
extern crate fmt_macros;
|
extern crate fmt_macros;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
#![crate_type="dylib"]
|
#![crate_type="dylib"]
|
||||||
#![feature(plugin_registrar, rustc_private)]
|
#![feature(plugin_registrar, rustc_private)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
extern crate rustc;
|
extern crate rustc;
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// Test that immutable pattern bindings cannot be reassigned.
|
// Test that immutable pattern bindings cannot be reassigned.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
enum E {
|
enum E {
|
||||||
Foo(isize)
|
Foo(isize)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// Test that we do not permit moves from &[] matched by a vec pattern.
|
// Test that we do not permit moves from &[] matched by a vec pattern.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
struct Foo {
|
struct Foo {
|
||||||
string: String
|
string: String
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn a<'a>() -> &'a [isize] {
|
fn a<'a>() -> &'a [isize] {
|
||||||
let vec = vec!(1, 2, 3, 4);
|
let vec = vec!(1, 2, 3, 4);
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn a() {
|
fn a() {
|
||||||
let mut v = vec!(1, 2, 3);
|
let mut v = vec!(1, 2, 3);
|
||||||
let vb: &mut [isize] = &mut v;
|
let vb: &mut [isize] = &mut v;
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut a = [1, 2, 3, 4];
|
let mut a = [1, 2, 3, 4];
|
||||||
let t = match a {
|
let t = match a {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
#![feature(box_patterns)]
|
#![feature(box_patterns)]
|
||||||
#![feature(box_syntax)]
|
#![feature(box_syntax)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn a() {
|
fn a() {
|
||||||
let mut vec = [box 1, box 2, box 3];
|
let mut vec = [box 1, box 2, box 3];
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn a<'a>() -> &'a isize {
|
fn a<'a>() -> &'a isize {
|
||||||
let vec = vec!(1, 2, 3, 4);
|
let vec = vec!(1, 2, 3, 4);
|
||||||
let vec: &[isize] = &vec; //~ ERROR `vec` does not live long enough
|
let vec: &[isize] = &vec; //~ ERROR `vec` does not live long enough
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = [ 1, 2, 3, 4, 5 ];
|
let x = [ 1, 2, 3, 4, 5 ];
|
||||||
match x {
|
match x {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let sl = vec![1,2,3];
|
let sl = vec![1,2,3];
|
||||||
let v: isize = match &*sl {
|
let v: isize = match &*sl {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) {
|
fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) {
|
||||||
match (l1, l2) {
|
match (l1, l2) {
|
||||||
([], []) => println!("both empty"),
|
([], []) => println!("both empty"),
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// compile-flags:-Z verbose
|
// compile-flags:-Z verbose
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = [1,2];
|
let x = [1,2];
|
||||||
let y = match x {
|
let y = match x {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = [1,2];
|
let x = [1,2];
|
||||||
let y = match x {
|
let y = match x {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let values: Vec<u8> = vec![1,2,3,4,5,6,7,8];
|
let values: Vec<u8> = vec![1,2,3,4,5,6,7,8];
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(rustc_attrs)]
|
#![feature(rustc_attrs)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
// Matching against NaN should result in a warning
|
// Matching against NaN should result in a warning
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
// The arity of `ref x` is always 1. If the pattern is compared to some non-structural type whose
|
// The arity of `ref x` is always 1. If the pattern is compared to some non-structural type whose
|
||||||
// arity is always 0, an ICE occurs.
|
// arity is always 0, an ICE occurs.
|
||||||
//
|
//
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn a() {
|
fn a() {
|
||||||
let v = [1, 2, 3];
|
let v = [1, 2, 3];
|
||||||
match v {
|
match v {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match () {
|
match () {
|
||||||
[()] => { }
|
[()] => { }
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match "foo".to_string() {
|
match "foo".to_string() {
|
||||||
['f', 'o', ..] => {} //~ ERROR mismatched types
|
['f', 'o', ..] => {} //~ ERROR mismatched types
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: Vec<(isize, isize)> = Vec::new();
|
let x: Vec<(isize, isize)> = Vec::new();
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
enum t { a(u), b }
|
enum t { a(u), b }
|
||||||
enum u { c, d }
|
enum u { c, d }
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
enum t { a, b, }
|
enum t { a, b, }
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
struct Foo {
|
struct Foo {
|
||||||
first: bool,
|
first: bool,
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn assert_static<T: 'static>(_t: T) {}
|
fn assert_static<T: 'static>(_t: T) {}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
pub fn pat_vec_7() {
|
pub fn pat_vec_7() {
|
||||||
match [7, 77, 777, 7777] {
|
match [7, 77, 777, 7777] {
|
||||||
[x, y, ..] => x + y
|
[x, y, ..] => x + y
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
struct D { x: u8 }
|
struct D { x: u8 }
|
||||||
|
|
||||||
impl Drop for D { fn drop(&mut self) { } }
|
impl Drop for D { fn drop(&mut self) { } }
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
struct Foo(int, int, int, int);
|
struct Foo(int, int, int, int);
|
||||||
struct Bar{a: int, b: int, c: int, d: int}
|
struct Bar{a: int, b: int, c: int, d: int}
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
// Tests that match expression handles overlapped literal and range
|
// Tests that match expression handles overlapped literal and range
|
||||||
// properly in the presence of guard function.
|
// properly in the presence of guard function.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn val() -> uint { 1 }
|
fn val() -> uint { 1 }
|
||||||
|
|
||||||
static CONST: uint = 1;
|
static CONST: uint = 1;
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut x: &[_] = &[1, 2, 3, 4];
|
let mut x: &[_] = &[1, 2, 3, 4];
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
assert_eq!(count_members(&[1, 2, 3, 4]), 4);
|
assert_eq!(count_members(&[1, 2, 3, 4]), 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: (int, &[int]) = (2, &[1, 2]);
|
let x: (int, &[int]) = (2, &[1, 2]);
|
||||||
assert_eq!(match x {
|
assert_eq!(match x {
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
assert_eq!(match [0u8; 1024] {
|
assert_eq!(match [0u8; 1024] {
|
||||||
_ => 42_usize,
|
_ => 42_usize,
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
use std::ops::Add;
|
use std::ops::Add;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str {
|
fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) -> &'static str {
|
||||||
match (l1, l2) {
|
match (l1, l2) {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns,)]
|
#![feature(advanced_slice_patterns,)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn f<T,>(_: T,) {}
|
fn f<T,>(_: T,) {}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let x = [1, 2, 3];
|
let x = [1, 2, 3];
|
||||||
match x {
|
match x {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn a() {
|
fn a() {
|
||||||
let x = [1, 2, 3];
|
let x = [1, 2, 3];
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn foldl<T, U, F>(values: &[T],
|
fn foldl<T, U, F>(values: &[T],
|
||||||
initial: U,
|
initial: U,
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let x = &[1, 2, 3, 4, 5];
|
let x = &[1, 2, 3, 4, 5];
|
||||||
let x: &[int] = &[1, 2, 3, 4, 5];
|
let x: &[int] = &[1, 2, 3, 4, 5];
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(advanced_slice_patterns)]
|
#![feature(advanced_slice_patterns)]
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn a() {
|
fn a() {
|
||||||
let x = [1];
|
let x = [1];
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
struct Foo {
|
struct Foo {
|
||||||
string: String
|
string: String
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
#![feature(slice_patterns)]
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = [(), ()];
|
let x = [(), ()];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue