fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
919 B23 linesraw
1error: expected type, found `3`
2  --> $DIR/recover-from-bad-variant.rs:7:26
3   |
4LL |     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: for more information, see https://github.com/rust-lang/rust/issues/23416
11
12error[E0532]: expected tuple struct or tuple variant, found struct variant `Enum::Foo`
13  --> $DIR/recover-from-bad-variant.rs:10:9
14   |
15LL |     Foo { a: usize, b: usize },
16   |     -------------------------- `Enum::Foo` defined here
17...
18LL |         Enum::Foo(a, b) => {}
19   |         ^^^^^^^^^ did you mean `Enum::Foo { /* fields */ }`?
20
21error: aborting due to 2 previous errors
22
23For more information about this error, try `rustc --explain E0532`.