We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6b6d5c commit eb0d5beCopy full SHA for eb0d5be
src/test/ui/issues/issue-80607.rs
@@ -0,0 +1,10 @@
1
+// This tests makes sure the diagnostics print the offending enum variant, not just the type.
2
+pub enum Enum {
3
+ V1(i32),
4
+}
5
+
6
+pub fn foo(x: i32) -> Enum {
7
+ Enum::V1 { x } //~ ERROR field does not exist
8
9
10
+fn main() {}
src/test/ui/issues/issue-80607.stderr
@@ -0,0 +1,14 @@
+error[E0559]: variant `Enum::V1` has no field named `x`
+ --> $DIR/issue-80607.rs:7:16
+ |
+LL | V1(i32),
+ | -- `Enum` defined here
+...
+LL | Enum::V1 { x }
+ | -------- ^ field does not exist
+ | |
+ | `Enum` is a tuple variant, use the appropriate syntax: `Enum(/* fields */)`
11
12
+error: aborting due to previous error
13
14
+For more information about this error, try `rustc --explain E0559`.
0 commit comments