2019-03-26 19:36:07 -05:00
|
|
|
error: expected type, found `3`
|
|
|
|
--> $DIR/recover-from-bad-variant.rs:7:26
|
|
|
|
|
|
|
|
|
LL | let x = Enum::Foo(a: 3, b: 4);
|
2019-07-17 13:40:36 -05:00
|
|
|
| - ^ expected type
|
|
|
|
| |
|
|
|
|
| tried to parse a type due to this type ascription
|
2019-03-28 21:58:00 -05:00
|
|
|
|
|
2019-07-15 16:23:39 -05:00
|
|
|
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
|
2020-02-07 06:07:02 -06:00
|
|
|
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
|
2019-03-26 19:36:07 -05:00
|
|
|
|
2019-10-14 19:20:50 -05:00
|
|
|
error[E0532]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
|
2019-03-26 19:36:07 -05:00
|
|
|
--> $DIR/recover-from-bad-variant.rs:10:9
|
|
|
|
|
|
2019-09-22 13:27:55 -05:00
|
|
|
LL | Foo { a: usize, b: usize },
|
|
|
|
| -------------------------- `Enum::Foo` defined here
|
|
|
|
...
|
2019-03-26 19:36:07 -05:00
|
|
|
LL | Enum::Foo(a, b) => {}
|
2020-07-09 19:42:07 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ help: use struct pattern syntax instead: `Enum::Foo { a, b }`
|
2019-03-26 19:36:07 -05:00
|
|
|
|
2020-08-09 19:52:29 -05:00
|
|
|
error[E0769]: tuple variant `Enum::Bar` written as struct variant
|
|
|
|
--> $DIR/recover-from-bad-variant.rs:12:9
|
|
|
|
|
|
|
|
|
LL | Enum::Bar { a, b } => {}
|
2021-02-20 14:33:08 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: use the tuple variant pattern syntax instead
|
|
|
|
|
|
|
|
|
LL | Enum::Bar(a, b) => {}
|
2021-06-21 21:07:19 -05:00
|
|
|
| ~~~~~~
|
2020-08-09 19:52:29 -05:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2019-03-26 19:36:07 -05:00
|
|
|
|
2020-08-09 19:52:29 -05:00
|
|
|
Some errors have detailed explanations: E0532, E0769.
|
|
|
|
For more information about an error, try `rustc --explain E0532`.
|