-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Enforce even more library clippy lints in CI #161328
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
Open
ChrisDenton
wants to merge
34
commits into
rust-lang:main
Choose a base branch
from
ChrisDenton:clippy3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
cfbb1d6
clippy::manual_is_ascii_check
ChrisDenton e4f6415
clippy::manual_ignore_case_cmp
ChrisDenton 0f684e5
clippy::manual_hash_one
ChrisDenton cc299d7
clippy::excessive_precision
ChrisDenton fc3b63d
clippy::partialeq_ne_impl
ChrisDenton 71411ff
clippy::manual_contains
ChrisDenton 1110bbb
clippy::single_match
ChrisDenton 6b058b4
clippy::match_as_ref
ChrisDenton 4ff5c85
clippy::default_constructed_unit_structs
ChrisDenton fe7445a
clippy::redundant_closure
ChrisDenton 4c99af2
clippy::derivable_impls
ChrisDenton bf79c6f
clippy::partialeq_to_none
ChrisDenton 3dc163b
clippy::unnecessary_map_or
ChrisDenton 3b4a6dd
clippy::manual_clear
ChrisDenton 9ea8c6e
clippy::bind_instead_of_map
ChrisDenton 4f88014
clippy::redundant_slicing
ChrisDenton 27eccc9
clippy::transmutes_expressible_as_ptr_casts
ChrisDenton b49b508
clippy::manual_repeat_n
ChrisDenton 6cb5350
clippy::to_digit_is_some
ChrisDenton d5d51bb
clippy::double_must_use
ChrisDenton fd522d7
clippy::seek_from_current
ChrisDenton ba77379
clippy::mem_replace_option_with_some
ChrisDenton 17cac5a
clippy::mem_replace_option_with_none
ChrisDenton 0bce2cc
clippy::map_clone
ChrisDenton db38868
clippy::declare_interior_mutable_const
ChrisDenton ec3e1ea
clippy::assign_op_pattern
ChrisDenton 3bd3106
clippy::chunks_exact_to_as_chunks
ChrisDenton 167a56a
clippy::needless_raw_string_hashes
ChrisDenton 503192c
clippy::approx_constant
ChrisDenton 85e2152
clippy::neg_cmp_op_on_partial_ord
ChrisDenton 1cb9917
Ignore clippy failures in stdarch submodule
ChrisDenton 3df0d08
Enforce even more clippy lints in CI
ChrisDenton bc9565b
Allow lints on backtrace-rs
ChrisDenton d712c4e
ignore clippy::redundant_pattern_matching
ChrisDenton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is right; disabling this lint will just cause this to be unfulfilled.
View changes since the review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I think. Because these are default-enabled lints, we want to expect them for others calling clippy on libstd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reference explains it well.
expectworks basically the same as if you usedwarn. The difference is it either silences the warning or errors if no warning is emitted.So
expectworks even if the warning is allowed. Which can sometimes be useful on its own. I was just looking at some float functions and I do think it's worth usingexpectto ensure we've explicitly thought through the NaN cases if we're not going to use the NaN aware functions.But yes, the main use is if the user enables a lint (whether by default or manually) then they don't get a bunch of spurious warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I guess that I was a bit confused by this example: https://doc.rust-lang.org/stable/reference/attributes/diagnostics.html#r-attributes.diagnostics.expect.fulfillment
Since it would imply that allow and expect are order-dependent? Which I guess makes sense, but it's a bit weird.