about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2019-11-29 13:02:14 +0000
committerNadrieril <nadrieril+git@gmail.com>2019-12-02 16:03:03 +0000
commitef087d96f0fd44ce83ac8c44d11bbe3faa8e1c6a (patch)
tree95cfcb7a9063ab596a3aea8a50facf586a3e05f9 /src/test/ui
parenta476af22e8f4ec6a95561f0243b2ebd2936ee557 (diff)
downloadrust-ef087d96f0fd44ce83ac8c44d11bbe3faa8e1c6a.tar.gz
rust-ef087d96f0fd44ce83ac8c44d11bbe3faa8e1c6a.zip
Move recently changed tests to the correct file
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/or-patterns/exhaustiveness-pass.rs28
-rw-r--r--src/test/ui/or-patterns/exhaustiveness-pass.stderr38
-rw-r--r--src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs28
-rw-r--r--src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr32
4 files changed, 60 insertions, 66 deletions
diff --git a/src/test/ui/or-patterns/exhaustiveness-pass.rs b/src/test/ui/or-patterns/exhaustiveness-pass.rs
index 5c4e239b5e3..ce0fe6fc2a3 100644
--- a/src/test/ui/or-patterns/exhaustiveness-pass.rs
+++ b/src/test/ui/or-patterns/exhaustiveness-pass.rs
@@ -42,32 +42,4 @@ fn main() {
         ((0, 0) | (1, 0),) => {}
         _ => {}
     }
-
-    match (0,) {
-        (1
-         | 1,) => {} //~ ERROR unreachable
-        _ => {}
-    }
-    match [0; 2] {
-        [0
-            | 0 //~ ERROR unreachable
-        , 0
-            | 0] => {} //~ ERROR unreachable
-        _ => {}
-    }
-    match &[][..] {
-        [0] => {}
-        [0, _] => {}
-        [0, _, _] => {}
-        [1, ..] => {}
-        [1 //~ ERROR unreachable
-            | 2, ..] => {}
-        _ => {}
-    }
-    match Some(0) {
-        Some(0) => {}
-        Some(0 //~ ERROR unreachable
-             | 1) => {}
-        _ => {}
-    }
 }
diff --git a/src/test/ui/or-patterns/exhaustiveness-pass.stderr b/src/test/ui/or-patterns/exhaustiveness-pass.stderr
index 7ca02862b45..1f4278c4b80 100644
--- a/src/test/ui/or-patterns/exhaustiveness-pass.stderr
+++ b/src/test/ui/or-patterns/exhaustiveness-pass.stderr
@@ -1,44 +1,8 @@
-error: unreachable pattern
-  --> $DIR/exhaustiveness-pass.rs:48:12
-   |
-LL |          | 1,) => {}
-   |            ^
-   |
-note: lint level defined here
-  --> $DIR/exhaustiveness-pass.rs:4:9
-   |
-LL | #![deny(unreachable_patterns)]
-   |         ^^^^^^^^^^^^^^^^^^^^
-
-error: unreachable pattern
-  --> $DIR/exhaustiveness-pass.rs:55:15
-   |
-LL |             | 0] => {}
-   |               ^
-
-error: unreachable pattern
-  --> $DIR/exhaustiveness-pass.rs:53:15
-   |
-LL |             | 0
-   |               ^
-
-error: unreachable pattern
-  --> $DIR/exhaustiveness-pass.rs:63:10
-   |
-LL |         [1
-   |          ^
-
-error: unreachable pattern
-  --> $DIR/exhaustiveness-pass.rs:69:14
-   |
-LL |         Some(0
-   |              ^
-
 error: or-patterns are not fully implemented yet
   --> $DIR/exhaustiveness-pass.rs:10:10
    |
 LL |         (0 | _,) => {}
    |          ^^^^^
 
-error: aborting due to 6 previous errors
+error: aborting due to previous error
 
diff --git a/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs b/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs
index 2cd8ca2dbac..860c7a1bde5 100644
--- a/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs
+++ b/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs
@@ -48,4 +48,32 @@ fn main() {
         ((1..=4,),) => {}, //~ ERROR unreachable pattern
         _ => {},
     }
+
+    match (0,) {
+        (1
+         | 1,) => {} //~ ERROR unreachable
+        _ => {}
+    }
+    match [0; 2] {
+        [0
+            | 0 //~ ERROR unreachable
+        , 0
+            | 0] => {} //~ ERROR unreachable
+        _ => {}
+    }
+    match &[][..] {
+        [0] => {}
+        [0, _] => {}
+        [0, _, _] => {}
+        [1, ..] => {}
+        [1 //~ ERROR unreachable
+            | 2, ..] => {}
+        _ => {}
+    }
+    match Some(0) {
+        Some(0) => {}
+        Some(0 //~ ERROR unreachable
+             | 1) => {}
+        _ => {}
+    }
 }
diff --git a/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr b/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr
index a4d55d805c3..87f69a484bb 100644
--- a/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr
+++ b/src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.stderr
@@ -70,11 +70,41 @@ error: unreachable pattern
 LL |         ((1..=4,),) => {},
    |         ^^^^^^^^^^^
 
+error: unreachable pattern
+  --> $DIR/exhaustiveness-unreachable-pattern.rs:54:12
+   |
+LL |          | 1,) => {}
+   |            ^
+
+error: unreachable pattern
+  --> $DIR/exhaustiveness-unreachable-pattern.rs:61:15
+   |
+LL |             | 0] => {}
+   |               ^
+
+error: unreachable pattern
+  --> $DIR/exhaustiveness-unreachable-pattern.rs:59:15
+   |
+LL |             | 0
+   |               ^
+
+error: unreachable pattern
+  --> $DIR/exhaustiveness-unreachable-pattern.rs:69:10
+   |
+LL |         [1
+   |          ^
+
+error: unreachable pattern
+  --> $DIR/exhaustiveness-unreachable-pattern.rs:75:14
+   |
+LL |         Some(0
+   |              ^
+
 error: or-patterns are not fully implemented yet
   --> $DIR/exhaustiveness-unreachable-pattern.rs:10:10
    |
 LL |         (0 | _,) => {}
    |          ^^^^^
 
-error: aborting due to 12 previous errors
+error: aborting due to 17 previous errors