-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Extend allow/warn/etc attributes to be applicable to individual use declarations #10534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What's the main usecase here? |
@cmr The particular instance that I encountered was that I had some code that I commented out temporarily, and that commented out code was the only use of some import among a large set of declarations. I wanted to stop seeing the warnings about that import. |
There is also some issue of consistency about where the setting of lint levels is permitted. Due to the way it's currently implemented, lints that are checked outside of |
Still an issue. |
…llogiq Flag `bufreader.lines().filter_map(Result::ok)` as suspicious This lint detects a problem that happened recently in https://github.com/uutils/coreutils and is described in rust-lang#64144. changelog: [`lines_filter_map_ok`]: new lint
Right now, the allow/warn/deny/forbid attributes can only be applied to entire modules.
It would be nice to be able to apply the attributes to individual
use
declarations, to be able to say, e.g., "I know that this particular import is not currently used in the module, and I do not want to be warned about it; but I do not want to turn off warnings for other imports in the module."Concrete example:
(Also, the fact that the syntax is currently accepted when applied to individual
use
declarations, as above, but seems to be a no-op, is probably also suboptimal. But of course, I would fix the problem by making it have an effect, as described by this ticket.)The text was updated successfully, but these errors were encountered: