Incorrect warning for unused field. #92995
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.
Uh oh!
There was an error while loading. Please reload this page.
(Note entirely sure what the intended behaviour is here, but named fields versus tuple fields are treated differently, which seems wrong.)
Given the following code: (https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8c1b3d36eae323990f50c01d182c042d)
The current output is:
But the field is actually read due to the
#[derive(Default)]
and the use of that.Arguable, a warning here is sensible in that as the usage is "debug" output only. But in that case it is hard to see why this doesn't warn also (https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a03f26d9f9c53bda612313913bfaf67e):
At least these two should be treated consistently?
The text was updated successfully, but these errors were encountered: