about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs15
-rw-r--r--tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr40
2 files changed, 12 insertions, 43 deletions
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs
index a9527d7d0c4..4f52f6ee4bd 100644
--- a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs
@@ -1,18 +1,13 @@
+#![feature(never_type)]
 #![feature(never_patterns)]
-#![feature(if_let_guard)]
 #![allow(incomplete_features)]
 
-fn split_last(_: &()) -> Option<(&i32, &i32)> {
-    None
-}
+enum Void {}
 
-fn assign_twice() {
+fn foo(x: Void) {
     loop {
-        match () {
-            (!| //~ ERROR: mismatched types
-            !) if let _ = split_last(&()) => {} //~ ERROR a never pattern is always unreachable
-            //~^ ERROR: mismatched types
-            //~^^ WARNING: irrefutable `if let` guard pattern [irrefutable_let_patterns]
+        match x {
+            (!|!) if false => {} //~ ERROR a never pattern is always unreachable
             _ => {}
         }
     }
diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr
index 896c95f1866..cc451fed318 100644
--- a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr
+++ b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr
@@ -1,37 +1,11 @@
 error: a never pattern is always unreachable
-  --> $DIR/ICE-133063-never-arm-no-otherwise-block.rs:13:46
+  --> $DIR/ICE-133063-never-arm-no-otherwise-block.rs:10:31
    |
-LL |             !) if let _ = split_last(&()) => {}
-   |                                              ^^
-   |                                              |
-   |                                              this will never be executed
-   |                                              help: remove this expression
+LL |             (!|!) if false => {}
+   |                               ^^
+   |                               |
+   |                               this will never be executed
+   |                               help: remove this expression
 
-error: mismatched types
-  --> $DIR/ICE-133063-never-arm-no-otherwise-block.rs:12:14
-   |
-LL |             (!|
-   |              ^ a never pattern must be used on an uninhabited type
-   |
-   = note: the matched value is of type `()`
-
-error: mismatched types
-  --> $DIR/ICE-133063-never-arm-no-otherwise-block.rs:13:13
-   |
-LL |             !) if let _ = split_last(&()) => {}
-   |             ^ a never pattern must be used on an uninhabited type
-   |
-   = note: the matched value is of type `()`
-
-warning: irrefutable `if let` guard pattern
-  --> $DIR/ICE-133063-never-arm-no-otherwise-block.rs:13:19
-   |
-LL |             !) if let _ = split_last(&()) => {}
-   |                   ^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: this pattern will always match, so the guard is useless
-   = help: consider removing the guard and adding a `let` inside the match arm
-   = note: `#[warn(irrefutable_let_patterns)]` on by default
-
-error: aborting due to 3 previous errors; 1 warning emitted
+error: aborting due to 1 previous error