about summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-05-26 22:46:08 -0700
committerbors <bors@rust-lang.org>2016-05-26 22:46:08 -0700
commit36d5dc7c9bcfd287b5c4e4ac3e2f0ab93bdaa0c9 (patch)
tree7e1af7784abe1ebab1c219d13e1a57439eb91996 /src/test/parse-fail
parent97e3a2401e4b2f659d69ed0c0822cae04e3495b7 (diff)
parent63dfbdbc1bc1ace106a525682f77b3d08af9ad71 (diff)
downloadrust-36d5dc7c9bcfd287b5c4e4ac3e2f0ab93bdaa0c9.tar.gz
rust-36d5dc7c9bcfd287b5c4e4ac3e2f0ab93bdaa0c9.zip
Auto merge of #33864 - Manishearth:breaking-batch, r=Manishearth
Batch up libsyntax breaking changes

cc https://github.com/rust-lang/rust/issues/31645
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/pat-lt-bracket-6.rs3
-rw-r--r--src/test/parse-fail/pat-lt-bracket-7.rs3
-rw-r--r--src/test/parse-fail/pat-tuple-1.rs17
-rw-r--r--src/test/parse-fail/pat-tuple-2.rs17
-rw-r--r--src/test/parse-fail/pat-tuple-3.rs17
-rw-r--r--src/test/parse-fail/pat-tuple-4.rs17
-rw-r--r--src/test/parse-fail/pat-tuple-5.rs17
-rw-r--r--src/test/parse-fail/pat-tuple-6.rs17
8 files changed, 104 insertions, 4 deletions
diff --git a/src/test/parse-fail/pat-lt-bracket-6.rs b/src/test/parse-fail/pat-lt-bracket-6.rs
index 5ed8f6dee8c..fb78e558a95 100644
--- a/src/test/parse-fail/pat-lt-bracket-6.rs
+++ b/src/test/parse-fail/pat-lt-bracket-6.rs
@@ -9,6 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    let Test(&desc[..]) = x; //~ error: expected one of `,` or `@`, found `[`
-    //~^ ERROR expected one of `:`, `;`, `=`, or `@`, found `[`
+    let Test(&desc[..]) = x; //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
 }
diff --git a/src/test/parse-fail/pat-lt-bracket-7.rs b/src/test/parse-fail/pat-lt-bracket-7.rs
index 00681e61497..d75589d8889 100644
--- a/src/test/parse-fail/pat-lt-bracket-7.rs
+++ b/src/test/parse-fail/pat-lt-bracket-7.rs
@@ -9,6 +9,5 @@
 // except according to those terms.
 
 fn main() {
-    for thing(x[]) in foo {} //~ error: expected one of `,` or `@`, found `[`
-    //~^ ERROR expected one of `@` or `in`, found `[`
+    for thing(x[]) in foo {} //~ ERROR: expected one of `)`, `,`, or `@`, found `[`
 }
diff --git a/src/test/parse-fail/pat-tuple-1.rs b/src/test/parse-fail/pat-tuple-1.rs
new file mode 100644
index 00000000000..945d0740654
--- /dev/null
+++ b/src/test/parse-fail/pat-tuple-1.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+    match 0 {
+        (, ..) => {} //~ ERROR expected pattern, found `,`
+    }
+}
diff --git a/src/test/parse-fail/pat-tuple-2.rs b/src/test/parse-fail/pat-tuple-2.rs
new file mode 100644
index 00000000000..ad52fa57870
--- /dev/null
+++ b/src/test/parse-fail/pat-tuple-2.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+    match 0 {
+        (pat, ..,) => {} //~ ERROR expected pattern, found `)`
+    }
+}
diff --git a/src/test/parse-fail/pat-tuple-3.rs b/src/test/parse-fail/pat-tuple-3.rs
new file mode 100644
index 00000000000..029dc7a2956
--- /dev/null
+++ b/src/test/parse-fail/pat-tuple-3.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+    match 0 {
+        (.., pat, ..) => {} //~ ERROR `..` can only be used once per tuple or tuple struct pattern
+    }
+}
diff --git a/src/test/parse-fail/pat-tuple-4.rs b/src/test/parse-fail/pat-tuple-4.rs
new file mode 100644
index 00000000000..f4c3afa07f1
--- /dev/null
+++ b/src/test/parse-fail/pat-tuple-4.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+    match 0 {
+        (.. pat) => {} //~ ERROR expected one of `)` or `,`, found `pat`
+    }
+}
diff --git a/src/test/parse-fail/pat-tuple-5.rs b/src/test/parse-fail/pat-tuple-5.rs
new file mode 100644
index 00000000000..145d1f9d8ec
--- /dev/null
+++ b/src/test/parse-fail/pat-tuple-5.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+    match 0 {
+        (pat ..) => {} //~ ERROR expected one of `)`, `,`, or `@`, found `..`
+    }
+}
diff --git a/src/test/parse-fail/pat-tuple-6.rs b/src/test/parse-fail/pat-tuple-6.rs
new file mode 100644
index 00000000000..3252d92fe1b
--- /dev/null
+++ b/src/test/parse-fail/pat-tuple-6.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-flags: -Z parse-only
+
+fn main() {
+    match 0 {
+        (pat) => {} //~ ERROR expected one of `,` or `@`, found `)`
+    }
+}