incorrectly ignoring a field with { _ }
yields suggestion that assumes _
is a valid field name
#83263
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
hi,
I think I ran into a bit of an error reporting hickup with my erroneous code.
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=cb47de4bf36f023caa0c21fc77ec4271
The current output is:
Applying this suggestion yields
Instead, I would've expected the suggestion to be along the lines of:
or at least
@jonas-schievink pointed out to me that this is likely caused by
rustc
recognizing that_
is not a valid field pattern, trying to recover from it by treating it as something like_: _
, which also fails because there's no field named_
– but of course this is not a valid field name at all, which should be recognized as such?The text was updated successfully, but these errors were encountered: