1- error: invalid `struct` delimiters or `fn` call arguments
2- --> $DIR/recover-from-bad-variant.rs:7:13
1+ error: expected expression, found `:`
2+ --> $DIR/recover-from-bad-variant.rs:7:24
3+ |
4+ LL | let x = Enum::Foo(a: 3, b: 4);
5+ | ^ expected expression
6+ |
7+ help: if this is a parameter, remove the name for the parameter
8+ |
9+ LL - let x = Enum::Foo(a: 3, b: 4);
10+ LL + let x = Enum::Foo(3, b: 4);
11+ |
12+
13+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
14+ --> $DIR/recover-from-bad-variant.rs:7:24
315 |
416LL | let x = Enum::Foo(a: 3, b: 4);
5- | ^^^^^^^^^^^^^^^^^^^^^
17+ | ^
18+ | |
19+ | expected one of 8 possible tokens
20+ | help: missing `,`
21+
22+ error: expected expression, found `:`
23+ --> $DIR/recover-from-bad-variant.rs:7:30
624 |
7- help: if `Enum::Foo` is a struct, use braces as delimiters
25+ LL | let x = Enum::Foo(a: 3, b: 4);
26+ | ^ expected expression
827 |
9- LL | let x = Enum::Foo { a: 3, b: 4 };
10- | ~ ~
11- help: if `Enum::Foo` is a function, use the arguments directly
28+ help: if this is a parameter, remove the name for the parameter
1229 |
1330LL - let x = Enum::Foo(a: 3, b: 4);
14- LL + let x = Enum::Foo(3, 4);
31+ LL + let x = Enum::Foo(a: 3, 4);
32+ |
33+
34+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
35+ --> $DIR/recover-from-bad-variant.rs:7:30
1536 |
37+ LL | let x = Enum::Foo(a: 3, b: 4);
38+ | ^
39+ | |
40+ | expected one of 8 possible tokens
41+ | help: missing `,`
42+
43+ error[E0425]: cannot find value `a` in this scope
44+ --> $DIR/recover-from-bad-variant.rs:7:23
45+ |
46+ LL | let x = Enum::Foo(a: 3, b: 4);
47+ | ^ not found in this scope
48+
49+ error[E0425]: cannot find value `b` in this scope
50+ --> $DIR/recover-from-bad-variant.rs:7:29
51+ |
52+ LL | let x = Enum::Foo(a: 3, b: 4);
53+ | ^ not found in this scope
54+
55+ error[E0533]: expected value, found struct variant `Enum::Foo`
56+ --> $DIR/recover-from-bad-variant.rs:7:13
57+ |
58+ LL | let x = Enum::Foo(a: 3, b: 4);
59+ | ^^^^^^^^^ not a value
1660
1761error[E0164]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
1862 --> $DIR/recover-from-bad-variant.rs:10:9
@@ -31,7 +75,7 @@ help: use the tuple variant pattern syntax instead
3175LL | Enum::Bar(a, b) => {}
3276 | ~~~~~~
3377
34- error: aborting due to 3 previous errors
78+ error: aborting due to 9 previous errors
3579
36- Some errors have detailed explanations: E0164, E0769.
80+ Some errors have detailed explanations: E0164, E0425, E0533, E0769.
3781For more information about an error, try `rustc --explain E0164`.
0 commit comments