Files
rust/tests/ui/parser/struct-field-numeric-shorthand.rs
T
Kevin Reid f5d3b158b9 Don’t report missing fields in struct exprs with syntax errors.
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.
2026-02-28 20:32:20 -08:00

9 lines
206 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`
}