Attempt to recover from parse errors while parsing a struct's literal fields by skipping tokens until a comma or the closing brace is found. This allows errors in other fields to be reported.
9 lines
274 B
Rust
9 lines
274 B
Rust
struct Rgb(u8, u8, u8);
|
|
|
|
fn main() {
|
|
let _ = Rgb { 0, 1, 2 };
|
|
//~^ ERROR expected identifier, found `0`
|
|
//~| ERROR expected identifier, found `1`
|
|
//~| ERROR expected identifier, found `2`
|
|
//~| ERROR missing fields `0`, `1`, `2` in initializer of `Rgb`
|
|
}
|