about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorrChaser53 <tayoshizawa29@gmail.com>2019-07-30 14:32:38 +0900
committerSeiichi Uchida <seuchida@gmail.com>2019-07-30 14:32:38 +0900
commitfe05e8883150ede9cd8efcff47374b5894d74eb7 (patch)
tree65799ff6ed2f40b9de3e7bf696e18fededab613a /tests
parent365461349d83e5b39bd3dcc704356f0822de0f65 (diff)
fix to build with rustc 1.38.0-nightly (4560cb830 2019-07-28) (#3712)
Diffstat (limited to 'tests')
-rw-r--r--tests/source/pattern.rs18
-rw-r--r--tests/target/issue-1021.rs2
-rw-r--r--tests/target/issue-2936.rs2
-rw-r--r--tests/target/issue-3711.rs6
-rw-r--r--tests/target/pattern.rs16
5 files changed, 34 insertions, 10 deletions
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] => {}
         _ => {}
     }
 }
diff --git a/tests/target/issue-1021.rs b/tests/target/issue-1021.rs
index ba1029d4e61..94911d1f8ee 100644
--- a/tests/target/issue-1021.rs
+++ b/tests/target/issue-1021.rs
@@ -15,7 +15,7 @@ fn main() {
         (true, ..) => (),
         (.., true) => (),
         (..) => (),
-        (_,) => (),
+        (_) => (),
         (/* .. */ ..) => (),
         (/* .. */ .., true) => (),
     }
diff --git a/tests/target/issue-2936.rs b/tests/target/issue-2936.rs
index 876050a20f4..3d5207597c4 100644
--- a/tests/target/issue-2936.rs
+++ b/tests/target/issue-2936.rs
@@ -10,7 +10,7 @@ impl Something for AStruct {
             ContextualParseError::InvalidMediaRule(ref err) => {
                 let err: &CStr = match err.kind {
                     ParseErrorKind::Custom(StyleParseErrorKind::MediaQueryExpectedFeatureName(
-                        ..
+                        ..,
                     )) => cstr!("PEMQExpectedFeatureName"),
                 };
             }
diff --git a/tests/target/issue-3711.rs b/tests/target/issue-3711.rs
new file mode 100644
index 00000000000..62d986e7734
--- /dev/null
+++ b/tests/target/issue-3711.rs
@@ -0,0 +1,6 @@
+fn main() {
+    println!(
+        "{}", // comment
+        111
+    );
+}
diff --git a/tests/target/pattern.rs b/tests/target/pattern.rs
index 79c8bbb90bf..d8a96d64920 100644
--- a/tests/target/pattern.rs
+++ b/tests/target/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,
@@ -18,9 +21,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;
@@ -42,6 +45,11 @@ fn main() {
         x,
         yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy: ref foo,
     };
+
+    match b"12" {
+        [0, 1..MAX] => {}
+        _ => {}
+    }
 }
 
 impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> {
@@ -79,7 +87,7 @@ fn combine_patterns() {
 fn slice_patterns() {
     match b"123" {
         [0, ..] => {}
-        [0, foo..] => {}
+        [0, foo] => {}
         _ => {}
     }
 }