summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr')
-rw-r--r--tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr69
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr b/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
new file mode 100644
index 000000000..de1bf8be8
--- /dev/null
+++ b/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
@@ -0,0 +1,69 @@
+error: unreachable pattern
+ --> $DIR/enum_same_crate_empty_match.rs:28:9
+ |
+LL | _ => {}
+ | ^
+ |
+note: the lint level is defined here
+ --> $DIR/enum_same_crate_empty_match.rs:1:9
+ |
+LL | #![deny(unreachable_patterns)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error[E0004]: non-exhaustive patterns: `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
+ --> $DIR/enum_same_crate_empty_match.rs:33:11
+ |
+LL | match NonExhaustiveEnum::Unit {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
+ |
+note: `NonExhaustiveEnum` defined here
+ --> $DIR/enum_same_crate_empty_match.rs:5:5
+ |
+LL | pub enum NonExhaustiveEnum {
+ | -----------------
+LL | Unit,
+ | ^^^^ not covered
+LL |
+LL | Tuple(u32),
+ | ^^^^^ not covered
+LL |
+LL | Struct { field: u32 }
+ | ^^^^^^ not covered
+ = note: the matched value is of type `NonExhaustiveEnum`
+help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
+ |
+LL ~ match NonExhaustiveEnum::Unit {
+LL + NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_) | NonExhaustiveEnum::Struct { .. } => todo!(),
+LL + }
+ |
+
+error[E0004]: non-exhaustive patterns: `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
+ --> $DIR/enum_same_crate_empty_match.rs:35:11
+ |
+LL | match NormalEnum::Unit {}
+ | ^^^^^^^^^^^^^^^^ patterns `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
+ |
+note: `NormalEnum` defined here
+ --> $DIR/enum_same_crate_empty_match.rs:14:5
+ |
+LL | pub enum NormalEnum {
+ | ----------
+LL | Unit,
+ | ^^^^ not covered
+LL |
+LL | Tuple(u32),
+ | ^^^^^ not covered
+LL |
+LL | Struct { field: u32 }
+ | ^^^^^^ not covered
+ = note: the matched value is of type `NormalEnum`
+help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
+ |
+LL ~ match NormalEnum::Unit {
+LL + NormalEnum::Unit | NormalEnum::Tuple(_) | NormalEnum::Struct { .. } => todo!(),
+LL + }
+ |
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0004`.