]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/recover-from-bad-variant.stderr
Rollup merge of #93337 - Amanieu:asm_tracking, r=tmiasko
[rust.git] / src / test / ui / parser / recover-from-bad-variant.stderr
1 error: invalid `struct` delimiters or `fn` call arguments
2   --> $DIR/recover-from-bad-variant.rs:7:13
3    |
4 LL |     let x = Enum::Foo(a: 3, b: 4);
5    |             ^^^^^^^^^^^^^^^^^^^^^
6    |
7 help: if `Enum::Foo` is a struct, use braces as delimiters
8    |
9 LL |     let x = Enum::Foo { a: 3, b: 4 };
10    |                       ~            ~
11 help: if `Enum::Foo` is a function, use the arguments directly
12    |
13 LL -     let x = Enum::Foo(a: 3, b: 4);
14 LL +     let x = Enum::Foo(3, 4);
15    | 
16
17 error[E0532]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
18   --> $DIR/recover-from-bad-variant.rs:10:9
19    |
20 LL |     Foo { a: usize, b: usize },
21    |     -------------------------- `Enum::Foo` defined here
22 ...
23 LL |         Enum::Foo(a, b) => {}
24    |         ^^^^^^^^^^^^^^^ help: use struct pattern syntax instead: `Enum::Foo { a, b }`
25
26 error[E0769]: tuple variant `Enum::Bar` written as struct variant
27   --> $DIR/recover-from-bad-variant.rs:12:9
28    |
29 LL |         Enum::Bar { a, b } => {}
30    |         ^^^^^^^^^^^^^^^^^^
31    |
32 help: use the tuple variant pattern syntax instead
33    |
34 LL |         Enum::Bar(a, b) => {}
35    |                  ~~~~~~
36
37 error: aborting due to 3 previous errors
38
39 Some errors have detailed explanations: E0532, E0769.
40 For more information about an error, try `rustc --explain E0532`.