summaryrefslogtreecommitdiffstats
path: root/tests/ui/did_you_mean/issue-43871-enum-instead-of-variant.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/did_you_mean/issue-43871-enum-instead-of-variant.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/did_you_mean/issue-43871-enum-instead-of-variant.stderr')
-rw-r--r--tests/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr66
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr b/tests/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
new file mode 100644
index 000000000..9dde5b3eb
--- /dev/null
+++ b/tests/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
@@ -0,0 +1,66 @@
+error[E0532]: expected tuple struct or tuple variant, found enum `Option`
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:21:12
+ |
+LL | if let Option(_) = x {
+ | ^^^^^^ help: try to match against one of the enum's variants: `std::option::Option::Some`
+ |
+ = help: you might have meant to match against the enum's non-tuple variant
+
+error[E0532]: expected tuple struct or tuple variant, found enum `Example`
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:27:12
+ |
+LL | if let Example(_) = y {
+ | ^^^^^^^ help: try to match against one of the enum's variants: `Example::Ex`
+ |
+ = help: you might have meant to match against the enum's non-tuple variant
+note: the enum is defined here
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:1:1
+ |
+LL | enum Example { Ex(String), NotEx }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0423]: expected function, tuple struct or tuple variant, found enum `Option`
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:19:13
+ |
+LL | let x = Option(1);
+ | ^^^^^^ help: try to construct one of the enum's variants: `std::option::Option::Some`
+ |
+ = help: you might have meant to construct the enum's non-tuple variant
+
+error[E0423]: expected function, tuple struct or tuple variant, found enum `Void`
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:31:13
+ |
+LL | let y = Void();
+ | ^^^^
+ |
+ = help: the enum has no tuple variants to construct
+note: the enum is defined here
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:3:1
+ |
+LL | enum Void {}
+ | ^^^^^^^^^^^^
+
+error[E0423]: expected function, tuple struct or tuple variant, found enum `ManyVariants`
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:33:13
+ |
+LL | let z = ManyVariants();
+ | ^^^^^^^^^^^^
+ |
+ = help: the enum has no tuple variants to construct
+ = help: you might have meant to construct one of the enum's non-tuple variants
+note: the enum is defined here
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:5:1
+ |
+LL | / enum ManyVariants {
+LL | | One,
+LL | | Two,
+LL | | Three,
+... |
+LL | | Ten,
+LL | | }
+ | |_^
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0423, E0532.
+For more information about an error, try `rustc --explain E0423`.