]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/recover-from-bad-variant.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / 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[E0164]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
18   --> $DIR/recover-from-bad-variant.rs:10:9
19    |
20 LL |         Enum::Foo(a, b) => {}
21    |         ^^^^^^^^^^^^^^^ not a tuple struct or tuple variant
22
23 error[E0769]: tuple variant `Enum::Bar` written as struct variant
24   --> $DIR/recover-from-bad-variant.rs:12:9
25    |
26 LL |         Enum::Bar { a, b } => {}
27    |         ^^^^^^^^^^^^^^^^^^
28    |
29 help: use the tuple variant pattern syntax instead
30    |
31 LL |         Enum::Bar(a, b) => {}
32    |                  ~~~~~~
33
34 error: aborting due to 3 previous errors
35
36 Some errors have detailed explanations: E0164, E0769.
37 For more information about an error, try `rustc --explain E0164`.