A struct literal or pattern names a field the struct doesn't have, or names one field twice. The note lists the struct's fields.
Wrong#
struct P { x: int }
fn make(): P = P { x: 1, z: 2 }Fixed#
struct P { x: int }
fn make(): P = P { x: 1 }Common causes#
- A typo in a field name.
- A field that was renamed or removed from the struct.
- A field given twice, e.g. once directly and once by shorthand.