Display note for "unused variable" warning suggesting that the warning can be disabled via underscores #26720
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
For reference, see this Reddit thread
It seems to me that if you have code like this
Then in addition to the "unused variable" warning that you currently get:
it should also display a note, perhaps saying
Barring that, the lint could have an error code and the error explanation could mention that you can disable the warning in either of these ways.
I'm not sure if this note should only be displayed with
for
loops (and similar situations), or if it should be unconditionally displayed alongside the "unused variable" warning.The text was updated successfully, but these errors were encountered: