mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
f5d3b158b9
This prevents spurious errors when a field is intended to be present
but a preceding syntax error caused it not to be parsed. For example,
StructName { foo: 1 bar: 2 }
will not successfully parse a field `bar`, and we will report the syntax
error but not the missing field.
15 lines
191 B
Rust
15 lines
191 B
Rust
//@ run-rustfix
|
|
|
|
pub struct Foo {
|
|
pub first: bool,
|
|
pub second: u8,
|
|
}
|
|
|
|
fn main() {
|
|
let _ = Foo {
|
|
first: true
|
|
second: 25
|
|
//~^ ERROR expected one of
|
|
};
|
|
}
|