]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/recover-from-bad-variant.stderr
Merge commit '40dd3e2b7089b5e96714e064b731f6dbf17c61a9' into sync_cg_clif-2021-05-27
[rust.git] / src / test / ui / parser / recover-from-bad-variant.stderr
1 error: expected type, found `3`
2   --> $DIR/recover-from-bad-variant.rs:7:26
3    |
4 LL |     let x = Enum::Foo(a: 3, b: 4);
5    |                        - ^ expected type
6    |                        |
7    |                        tried to parse a type due to this type ascription
8    |
9    = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
10    = note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
11
12 error[E0532]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
13   --> $DIR/recover-from-bad-variant.rs:10:9
14    |
15 LL |     Foo { a: usize, b: usize },
16    |     -------------------------- `Enum::Foo` defined here
17 ...
18 LL |         Enum::Foo(a, b) => {}
19    |         ^^^^^^^^^^^^^^^ help: use struct pattern syntax instead: `Enum::Foo { a, b }`
20
21 error[E0769]: tuple variant `Enum::Bar` written as struct variant
22   --> $DIR/recover-from-bad-variant.rs:12:9
23    |
24 LL |         Enum::Bar { a, b } => {}
25    |         ^^^^^^^^^^^^^^^^^^
26    |
27 help: use the tuple variant pattern syntax instead
28    |
29 LL |         Enum::Bar(a, b) => {}
30    |                  ^^^^^^
31
32 error: aborting due to 3 previous errors
33
34 Some errors have detailed explanations: E0532, E0769.
35 For more information about an error, try `rustc --explain E0532`.