summaryrefslogtreecommitdiffstats
path: root/src/test/ui/never_type/exhaustive_patterns.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/never_type/exhaustive_patterns.stderr')
-rw-r--r--src/test/ui/never_type/exhaustive_patterns.stderr25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/never_type/exhaustive_patterns.stderr b/src/test/ui/never_type/exhaustive_patterns.stderr
new file mode 100644
index 000000000..e41baf862
--- /dev/null
+++ b/src/test/ui/never_type/exhaustive_patterns.stderr
@@ -0,0 +1,25 @@
+error[E0005]: refutable pattern in local binding: `Either::B(_)` not covered
+ --> $DIR/exhaustive_patterns.rs:20:9
+ |
+LL | let Either::A(()) = foo();
+ | ^^^^^^^^^^^^^ pattern `Either::B(_)` not covered
+ |
+ = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
+ = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
+note: `Either<(), !>` defined here
+ --> $DIR/exhaustive_patterns.rs:12:5
+ |
+LL | enum Either<A, B> {
+ | ------
+LL | A(A),
+LL | B(inner::Wrapper<B>),
+ | ^ not covered
+ = note: the matched value is of type `Either<(), !>`
+help: you might want to use `if let` to ignore the variant that isn't matched
+ |
+LL | if let Either::A(()) = foo() { todo!() }
+ | ++ ~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0005`.