Struct update syntax produces very confusing error messages when comma before .. is missed #104373
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Begin with the following working code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fb4c4c5e78cd9c3f549cdd806e68388a
Then, delete the
,
before..Default::default()
, resulting in:The current output is:
Ideally the output should explain that struct update syntax requires a comma separating the last field from the
..
notation and point to that line.Encountered in the wild in the Bevy community, although I run into this myself regularly when initializing structs by hand.
The text was updated successfully, but these errors were encountered: