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
33 |
44LL | let x = Enum::Foo(a: 3, b: 4);
5- | ^^^^^^^^^^^^^^^^^^^^^
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);
611 |
7- help: if `Enum::Foo` is a struct, use braces as delimiters
12+
13+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
14+ --> $DIR/recover-from-bad-variant.rs:7:24
815 |
9- LL | let x = Enum::Foo { a: 3, b: 4 };
10- | ~ ~
11- help: if `Enum::Foo` is a function, use the arguments directly
16+ LL | let x = Enum::Foo(a: 3, b: 4);
17+ | ^
18+ | |
19+ | expected one of 8 possible tokens
20+ | help: missing `,`
21+
22+ error: expected one of `)` or `,`, found `3`
23+ --> $DIR/recover-from-bad-variant.rs:7:26
24+ |
25+ LL | let x = Enum::Foo(a: 3, b: 4);
26+ | -^ expected one of `)` or `,`
27+ | |
28+ | help: missing `,`
29+
30+ error: expected expression, found `:`
31+ --> $DIR/recover-from-bad-variant.rs:7:30
32+ |
33+ LL | let x = Enum::Foo(a: 3, b: 4);
34+ | ^ expected expression
35+ |
36+ help: if this is a parameter, remove the name for the parameter
1237 |
1338LL - let x = Enum::Foo(a: 3, b: 4);
14- LL + let x = Enum::Foo(3, 4);
39+ LL + let x = Enum::Foo(a: 3, 4);
40+ |
41+
42+ error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `:`
43+ --> $DIR/recover-from-bad-variant.rs:7:30
1544 |
45+ LL | let x = Enum::Foo(a: 3, b: 4);
46+ | ^
47+ | |
48+ | expected one of 8 possible tokens
49+ | help: missing `,`
50+
51+ error: expected one of `)` or `,`, found `4`
52+ --> $DIR/recover-from-bad-variant.rs:7:32
53+ |
54+ LL | let x = Enum::Foo(a: 3, b: 4);
55+ | -^ expected one of `)` or `,`
56+ | |
57+ | help: missing `,`
58+
59+ error[E0425]: cannot find value `a` in this scope
60+ --> $DIR/recover-from-bad-variant.rs:7:23
61+ |
62+ LL | let x = Enum::Foo(a: 3, b: 4);
63+ | ^ not found in this scope
64+
65+ error[E0425]: cannot find value `b` in this scope
66+ --> $DIR/recover-from-bad-variant.rs:7:29
67+ |
68+ LL | let x = Enum::Foo(a: 3, b: 4);
69+ | ^ not found in this scope
70+
71+ error[E0533]: expected value, found struct variant `Enum::Foo`
72+ --> $DIR/recover-from-bad-variant.rs:7:13
73+ |
74+ LL | let x = Enum::Foo(a: 3, b: 4);
75+ | ^^^^^^^^^ not a value
1676
1777error[E0164]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
1878 --> $DIR/recover-from-bad-variant.rs:10:9
@@ -31,7 +91,7 @@ help: use the tuple variant pattern syntax instead
3191LL | Enum::Bar(a, b) => {}
3292 | ~~~~~~
3393
34- error: aborting due to 3 previous errors
94+ error: aborting due to 11 previous errors
3595
36- Some errors have detailed explanations: E0164, E0769.
96+ Some errors have detailed explanations: E0164, E0425, E0533, E0769.
3797For more information about an error, try `rustc --explain E0164`.
0 commit comments