diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-09-06 15:23:55 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-09-08 16:12:13 -0700 |
| commit | eb678ff87f0cdbf523b26fe9255cff684b4091e5 (patch) | |
| tree | 9fb3745051a57fd5f73d6d50aabf07ce9d2f6ea4 /src/test/compile-fail/borrowck-vec-pattern-nesting.rs | |
| parent | 6f34760e4173dda94162502153fe4c5a2a96fc9d (diff) | |
| download | rust-eb678ff87f0cdbf523b26fe9255cff684b4091e5.tar.gz rust-eb678ff87f0cdbf523b26fe9255cff684b4091e5.zip | |
librustc: Change the syntax of subslice matching to use postfix `..`
instead of prefix `..`.
This breaks code that looked like:
match foo {
[ first, ..middle, last ] => { ... }
}
Change this code to:
match foo {
[ first, middle.., last ] => { ... }
}
RFC #55.
Closes #16967.
[breaking-change]
Diffstat (limited to 'src/test/compile-fail/borrowck-vec-pattern-nesting.rs')
| -rw-r--r-- | src/test/compile-fail/borrowck-vec-pattern-nesting.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs index 4a56f982106..58932d1b422 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-nesting.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-nesting.rs @@ -22,7 +22,7 @@ fn b() { let mut vec = vec!(box 1i, box 2, box 3); let vec: &mut [Box<int>] = vec.as_mut_slice(); match vec { - [.._b] => { + [_b..] => { vec[0] = box 4; //~ ERROR cannot assign } } @@ -33,7 +33,7 @@ fn c() { let vec: &mut [Box<int>] = vec.as_mut_slice(); match vec { [_a, //~ ERROR cannot move out - .._b] => { //~^ NOTE attempting to move value to here + _b..] => { //~^ NOTE attempting to move value to here // Note: `_a` is *moved* here, but `b` is borrowing, // hence illegal. @@ -50,7 +50,7 @@ fn d() { let mut vec = vec!(box 1i, box 2, box 3); let vec: &mut [Box<int>] = vec.as_mut_slice(); match vec { - [.._a, //~ ERROR cannot move out + [_a.., //~ ERROR cannot move out _b] => {} //~ NOTE attempting to move value to here _ => {} } |
