rust/tests/ui/parser/recover/recover-enum2.rs
Esteban Küber 0ff331bc78 Change how for (x in foo) {} is handled
Use the same approach used for match arm patterns.
2023-11-29 18:47:32 +00:00

30 lines
490 B
Rust

fn main() {
enum Test {
Var1,
Var2(String),
Var3 {
abc: {}, //~ ERROR: expected type, found `{`
},
}
// recover...
let () = 1; //~ ERROR mismatched types
enum Test2 {
Fine,
}
enum Test3 {
StillFine {
def: i32,
},
}
{
// fail again
enum Test4 {
Nope(i32 {}) //~ ERROR: found `{`
}
let () = 1; //~ ERROR mismatched types
}
}