0ff331bc78
Use the same approach used for match arm patterns.
30 lines
490 B
Rust
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
|
|
}
|
|
}
|