Description
I believe that in the vast majority of cases when an unused variable is present, the author of the code intended to use it, but forgot. Thus the message suggesting to effectively turn off the warning is unhelpful.
I suggest changing it to something like:
help: you probably wanted to use it somehow, check the code around to see if it's the case
help: if you really intend to create the variable and not use it, prefix it with underscore: `_var`
While this doesn't concern me much personally, I believe it'd be much more helpful to novice programmers. To put it in extreme, imagine this kind of lint message: "Reference outlives borrowed value. Consider putting #![allow(undefined_behavior)]
at the top of your module."
And I must admit the current warning feels a bit strange to me too. ("Dear compiler, the content of your message is completely useless, but its presence saved my ass twice today, so thank you for that!")
Disclaimer: this is entirely based on my personal experience and may not be true in general. Feel free to close if there's a good evidence that I'm broken, not the compiler. :)
This issue has been assigned to @loris-intergalactique via this comment.