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
3
|
4
4
LL | 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);
6
11
|
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
8
15
|
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
12
37
|
13
38
LL - 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
15
44
|
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
16
76
17
77
error[E0164]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
18
78
--> $DIR/recover-from-bad-variant.rs:10:9
@@ -31,7 +91,7 @@ help: use the tuple variant pattern syntax instead
31
91
LL | Enum::Bar(a, b) => {}
32
92
| ~~~~~~
33
93
34
- error: aborting due to 3 previous errors
94
+ error: aborting due to 11 previous errors
35
95
36
- Some errors have detailed explanations: E0164, E0769.
96
+ Some errors have detailed explanations: E0164, E0425, E0533, E0769.
37
97
For more information about an error, try `rustc --explain E0164`.
0 commit comments