From 784ad6953edf5a82382e74223225382cb9ed12c4 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 29 Jul 2019 10:07:29 +0200 Subject: [PATCH 1/2] bump Rust --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index 2dc0d2bbcc..5178503f10 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -0e9b465d729d07101b29b4d096d83edf9be82df0 +8b94e9e9188b65df38a5f1ae723617dc2dfb3155 From 87f20fede528a2a99c06e6aae480adac91f5ecc2 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 29 Jul 2019 10:21:59 +0200 Subject: [PATCH 2/2] adjust for slice pattern changes --- tests/run-pass/issue-15080.rs | 4 ++-- tests/run-pass/issue-17877.rs | 4 ++-- tests/run-pass/subslice_array.rs | 2 +- tests/run-pass/vec-matching-fold.rs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/run-pass/issue-15080.rs b/tests/run-pass/issue-15080.rs index 3ef3718d52..7f19759b91 100644 --- a/tests/run-pass/issue-15080.rs +++ b/tests/run-pass/issue-15080.rs @@ -6,11 +6,11 @@ fn main() { let mut result = vec!(); loop { x = match *x { - [1, n, 3, ref rest..] => { + [1, n, 3, ref rest @ ..] => { result.push(n); rest } - [n, ref rest..] => { + [n, ref rest @ ..] => { result.push(n); rest } diff --git a/tests/run-pass/issue-17877.rs b/tests/run-pass/issue-17877.rs index caad8b2776..9cbc459ad0 100644 --- a/tests/run-pass/issue-17877.rs +++ b/tests/run-pass/issue-17877.rs @@ -9,8 +9,8 @@ fn main() { }, 42_usize); assert_eq!(match [0u8; 1024] { - [1, _..] => 0_usize, - [0, _..] => 1_usize, + [1, ..] => 0_usize, + [0, ..] => 1_usize, _ => 2_usize }, 1_usize); } diff --git a/tests/run-pass/subslice_array.rs b/tests/run-pass/subslice_array.rs index 5bbbffe4e6..df3631c647 100644 --- a/tests/run-pass/subslice_array.rs +++ b/tests/run-pass/subslice_array.rs @@ -6,7 +6,7 @@ fn bar(a: &'static str, b: &'static str) -> [&'static str; 4] { fn main() { let out = bar("baz", "foo"); - let [a, xs.., d] = out; + let [a, xs @ .., d] = out; assert_eq!(a, "baz"); assert_eq!(xs, ["foo", "foo"]); assert_eq!(d, "baz"); diff --git a/tests/run-pass/vec-matching-fold.rs b/tests/run-pass/vec-matching-fold.rs index f953e04747..54fbb70292 100644 --- a/tests/run-pass/vec-matching-fold.rs +++ b/tests/run-pass/vec-matching-fold.rs @@ -9,7 +9,7 @@ fn foldl(values: &[T], U: Clone+Debug, T:Debug, F: FnMut(U, &T) -> U, { match values { - &[ref head, ref tail..] => + &[ref head, ref tail @ ..] => foldl(tail, function(initial, head), function), &[] => { let res = initial.clone(); res @@ -25,7 +25,7 @@ fn foldr(values: &[T], F: FnMut(&T, U) -> U, { match values { - &[ref head.., ref tail] => + &[ref head @ .., ref tail] => foldr(head, function(tail, initial), function), &[] => { let res = initial.clone(); res