diff options
| author | bors <bors@rust-lang.org> | 2019-07-28 09:12:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-07-28 09:12:04 +0000 |
| commit | 0cfb2f7fbda1d27e12913d21d1c8e56a4133dbe1 (patch) | |
| tree | 5f511147f1c0f419f26fb362c24710e1cd459ec6 /src/test/ui/array-slice-vec | |
| parent | 9a239ef4ded03d155c72b68b5a2dd7aff013e141 (diff) | |
| parent | 370aa19f28ea6d42f1aaf6de39a294e5e4e9aab7 (diff) | |
| download | rust-0cfb2f7fbda1d27e12913d21d1c8e56a4133dbe1.tar.gz rust-0cfb2f7fbda1d27e12913d21d1c8e56a4133dbe1.zip | |
Auto merge of #63074 - Centril:rollup-k1a8z0n, r=Centril
Rollup of 8 pull requests Successful merges: - #62550 (Implement RFC 2707 + Parser recovery for range patterns) - #62759 (Actually add rustc-guide to toolstate, don't fail builds for the guide) - #62806 (Fix few Clippy warnings) - #62974 (bump crossbeam-epoch dependency) - #63051 (Avoid ICE when referencing desugared local binding in borrow error) - #63061 (In which we constantly improve the Vec(Deque) array PartialEq impls) - #63067 (Add test for issue-50900) - #63071 (Allow rustbot to add `F-*` + `requires-nightly`.) Failed merges: r? @ghost
Diffstat (limited to 'src/test/ui/array-slice-vec')
4 files changed, 11 insertions, 26 deletions
diff --git a/src/test/ui/array-slice-vec/vec-matching-fold.rs b/src/test/ui/array-slice-vec/vec-matching-fold.rs index 2b19c49c427..f416160db24 100644 --- a/src/test/ui/array-slice-vec/vec-matching-fold.rs +++ b/src/test/ui/array-slice-vec/vec-matching-fold.rs @@ -11,7 +11,7 @@ fn foldl<T, U, F>(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), &[] => { // FIXME: call guards @@ -28,7 +28,7 @@ fn foldr<T, U, F>(values: &[T], F: FnMut(&T, U) -> U, { match values { - &[ref head.., ref tail] => + &[ref head @ .., ref tail] => foldr(head, function(tail, initial), function), &[] => { // FIXME: call guards diff --git a/src/test/ui/array-slice-vec/vec-matching-legal-tail-element-borrow.rs b/src/test/ui/array-slice-vec/vec-matching-legal-tail-element-borrow.rs index bce03b3375e..f0602c328b0 100644 --- a/src/test/ui/array-slice-vec/vec-matching-legal-tail-element-borrow.rs +++ b/src/test/ui/array-slice-vec/vec-matching-legal-tail-element-borrow.rs @@ -8,7 +8,7 @@ pub fn main() { let x: &[isize] = &[1, 2, 3, 4, 5]; if !x.is_empty() { let el = match x { - &[1, ref tail..] => &tail[0], + &[1, ref tail @ ..] => &tail[0], _ => unreachable!() }; println!("{}", *el); diff --git a/src/test/ui/array-slice-vec/vec-matching.rs b/src/test/ui/array-slice-vec/vec-matching.rs index a37c25160fa..49c736bd728 100644 --- a/src/test/ui/array-slice-vec/vec-matching.rs +++ b/src/test/ui/array-slice-vec/vec-matching.rs @@ -14,7 +14,7 @@ fn a() { fn b() { let x = [1, 2, 3]; match x { - [a, b, c..] => { + [a, b, c @ ..] => { assert_eq!(a, 1); assert_eq!(b, 2); let expected: &[_] = &[3]; @@ -22,7 +22,7 @@ fn b() { } } match x { - [a.., b, c] => { + [a @ .., b, c] => { let expected: &[_] = &[1]; assert_eq!(a, expected); assert_eq!(b, 2); @@ -30,7 +30,7 @@ fn b() { } } match x { - [a, b.., c] => { + [a, b @ .., c] => { assert_eq!(a, 1); let expected: &[_] = &[2]; assert_eq!(b, expected); @@ -50,7 +50,7 @@ fn b() { fn b_slice() { let x : &[_] = &[1, 2, 3]; match x { - &[a, b, ref c..] => { + &[a, b, ref c @ ..] => { assert_eq!(a, 1); assert_eq!(b, 2); let expected: &[_] = &[3]; @@ -59,7 +59,7 @@ fn b_slice() { _ => unreachable!() } match x { - &[ref a.., b, c] => { + &[ref a @ .., b, c] => { let expected: &[_] = &[1]; assert_eq!(a, expected); assert_eq!(b, 2); @@ -68,7 +68,7 @@ fn b_slice() { _ => unreachable!() } match x { - &[a, ref b.., c] => { + &[a, ref b @ .., c] => { assert_eq!(a, 1); let expected: &[_] = &[2]; assert_eq!(b, expected); @@ -134,20 +134,6 @@ fn e() { assert_eq!(c, 1); } -fn f() { - let x = &[1, 2, 3, 4, 5]; - let [a, [b, [c, ..].., d].., e] = *x; - assert_eq!((a, b, c, d, e), (1, 2, 3, 4, 5)); - - let x: &[isize] = x; - let (a, b, c, d, e) = match *x { - [a, [b, [c, ..].., d].., e] => (a, b, c, d, e), - _ => unimplemented!() - }; - - assert_eq!((a, b, c, d, e), (1, 2, 3, 4, 5)); -} - pub fn main() { a(); b(); @@ -155,5 +141,4 @@ pub fn main() { c(); d(); e(); - f(); } diff --git a/src/test/ui/array-slice-vec/vec-tail-matching.rs b/src/test/ui/array-slice-vec/vec-tail-matching.rs index 84d246dff82..3c7b160dcc5 100644 --- a/src/test/ui/array-slice-vec/vec-tail-matching.rs +++ b/src/test/ui/array-slice-vec/vec-tail-matching.rs @@ -13,14 +13,14 @@ pub fn main() { Foo { string: "baz" } ]; match x { - [ref first, ref tail..] => { + [ref first, ref tail @ ..] => { assert_eq!(first.string, "foo"); assert_eq!(tail.len(), 2); assert_eq!(tail[0].string, "bar"); assert_eq!(tail[1].string, "baz"); match *(tail as &[_]) { - [Foo { .. }, _, Foo { .. }, ref _tail..] => { + [Foo { .. }, _, Foo { .. }, ref _tail @ ..] => { unreachable!(); } [Foo { string: ref a }, Foo { string: ref b }] => { |
