From fe05e8883150ede9cd8efcff47374b5894d74eb7 Mon Sep 17 00:00:00 2001 From: rChaser53 Date: Tue, 30 Jul 2019 14:32:38 +0900 Subject: fix to build with rustc 1.38.0-nightly (4560cb830 2019-07-28) (#3712) --- tests/source/pattern.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'tests/source/pattern.rs') diff --git a/tests/source/pattern.rs b/tests/source/pattern.rs index 184d23c8137..fc3b1455e0d 100644 --- a/tests/source/pattern.rs +++ b/tests/source/pattern.rs @@ -1,4 +1,7 @@ // rustfmt-normalize_comments: true +#![feature(exclusive_range_pattern)] +use core::u8::MAX; + fn main() { let z = match x { "pat1" => 1, @@ -16,9 +19,9 @@ fn main() { let foo@bar (f) = 42; let a::foo ( ..) = 42; let [ ] = 42; - let [a.., b,c ] = 42; - let [ a,b,c.. ] = 42; - let [a, b, c, d..,e,f, g] = 42; + let [a, b,c ] = 42; + let [ a,b,c ] = 42; + let [a, b, c, d,e,f, g] = 42; let foo { } = 42; let foo {..} = 42; let foo { x, y: ref foo, .. } = 42; @@ -26,6 +29,13 @@ fn main() { let foo { x, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: ref foo, } = 42; let foo { x, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: ref foo, .. }; let foo { x, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: ref foo, }; + + match b"12" { + [0, + 1..MAX + ] => {} + _ => {} + } } impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> { @@ -67,7 +77,7 @@ fn combine_patterns() { fn slice_patterns() { match b"123" { [0, ..] => {} - [0, foo..] => {} + [0, foo] => {} _ => {} } } -- cgit 1.4.1-3-g733a5