-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to clean up some lints and enable more
I came across the unused_extern_crates lint, which is allow-by-default. It is however part of the rust_2018_idioms lint group, which we are already denying. Anyway, this discovery led me down a linting rabbit hole. There is the unused_import_braces lint which arguable lints against something that rustfmt already deals with. Both the lint and rustfmt deal with the braces in "use test::{A};". Thus, this lint can just be dropped. The "unused" lint group includes "unused_must_use" and some other things that sound helpful, so let's just switch to the more generic lint. This found some unused_macro_rules in x11rb/src/tracing.rs, which need to be allowed, so this lint can just be denied and not forbidden. But some of the lints that we forbid are part of the "unused" group and #[deny]ing something that was previously #[forbid]en is an error. Thus, I am switching the order of these and move all the #[deny]s up. Next, I thought that "unused_qualifications" should be part of "unused", but it actually is not. The following code warns about the allows for unused_extern_crates and unused_must_use, but not unused_qualifications, so this is not part of the unused group. Same for unused_results. #![forbid(unused)] #![allow(unused_extern_crates)] #![allow(unused_must_use)] #![allow(unused_qualifications)] #![allow(unused_results)] Signed-off-by: Uli Schlachter <[email protected]>
- Loading branch information
Showing
8 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters