Skip to content

Commit 87f20fe

Browse files
committed
adjust for slice pattern changes
1 parent 784ad69 commit 87f20fe

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

tests/run-pass/issue-15080.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ fn main() {
66
let mut result = vec!();
77
loop {
88
x = match *x {
9-
[1, n, 3, ref rest..] => {
9+
[1, n, 3, ref rest @ ..] => {
1010
result.push(n);
1111
rest
1212
}
13-
[n, ref rest..] => {
13+
[n, ref rest @ ..] => {
1414
result.push(n);
1515
rest
1616
}

tests/run-pass/issue-17877.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ fn main() {
99
}, 42_usize);
1010

1111
assert_eq!(match [0u8; 1024] {
12-
[1, _..] => 0_usize,
13-
[0, _..] => 1_usize,
12+
[1, ..] => 0_usize,
13+
[0, ..] => 1_usize,
1414
_ => 2_usize
1515
}, 1_usize);
1616
}

tests/run-pass/subslice_array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn bar(a: &'static str, b: &'static str) -> [&'static str; 4] {
66

77
fn main() {
88
let out = bar("baz", "foo");
9-
let [a, xs.., d] = out;
9+
let [a, xs @ .., d] = out;
1010
assert_eq!(a, "baz");
1111
assert_eq!(xs, ["foo", "foo"]);
1212
assert_eq!(d, "baz");

tests/run-pass/vec-matching-fold.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn foldl<T, U, F>(values: &[T],
99
U: Clone+Debug, T:Debug,
1010
F: FnMut(U, &T) -> U,
1111
{ match values {
12-
&[ref head, ref tail..] =>
12+
&[ref head, ref tail @ ..] =>
1313
foldl(tail, function(initial, head), function),
1414
&[] => {
1515
let res = initial.clone(); res
@@ -25,7 +25,7 @@ fn foldr<T, U, F>(values: &[T],
2525
F: FnMut(&T, U) -> U,
2626
{
2727
match values {
28-
&[ref head.., ref tail] =>
28+
&[ref head @ .., ref tail] =>
2929
foldr(head, function(tail, initial), function),
3030
&[] => {
3131
let res = initial.clone(); res

0 commit comments

Comments
 (0)