-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Uplift the let_underscore
lints from clippy into rustc.
#97739
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
821b32b
Add `let_underscore_drop` lint.
a2aaron ad7587f
Add `let_underscore_lock` lint.
a2aaron 758a9fd
Add `let_underscore_must_use` lint.
a2aaron 36b6309
Move let_underscore tests to their own subfolder.
a2aaron ae2ac3b
Allow `let_underscore_drop` and `let_underscore_must_use` by default.
a2aaron eba6c78
Show code suggestions in `let_undescore` lint messages.
a2aaron 6b179e3
Set `let_underscore_lock` to Deny by default.
a2aaron a7e2b3e
Move local functions to outer scope.
a2aaron 7e485bf
Move `let_underscore` tests into the `lint` subfolder.
a2aaron 1421cff
Add `let_underscore` lint group to `GROUP_DESCRIPTIONS`.
a2aaron 30e8adb
Use `has_attr` instead of `get_attrs` in `has_must_use_attr`
a2aaron e6b6678
Bail out early if the type does not has a trivial Drop implementation.
a2aaron 6342b58
Use diagnostic items instead of hard coded paths for `let_underscore_…
a2aaron 11663b1
Use `check-pass` instead of `run-pass`
a2aaron b5b5b54
Remove `let_underscore_must_use`
a2aaron 321a598
Add diagnostic items to MutexGuard and RwLock Guards
a2aaron 211feb1
Add `{{produces}}` tag to lint doc comments.
a2aaron cdf6606
Use `multipart_suggestion` to create an applicable suggestion.
a2aaron 7237e86
Reword suggestion messages.
a2aaron b040666
Have the drop code suggestion not include `let _ =`
a2aaron 8807c2d
Make `let_underscore_drop` Deny by default.
a2aaron a9095ff
Re-allow `let_underscore_drop` by default.
a2aaron a9f1b7b
Explain why let-underscoring a lock guard is incorrect.
a2aaron d355ec9
Fix imports.
a2aaron 76c90c3
Use `#![warn(let_underscore_drop)]` in tests.
a2aaron 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
Use diagnostic items instead of hard coded paths for `let_underscore_…
…lock` Using diagnostic items avoids having to update the paths if the guard types ever get moved around for some reason. Additionally, it also greatly simplifies the `is_sync_lock` check.
- Loading branch information
commit 6342b58ef0f71ca0284dced4b1d22f9726c1c74a
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
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.
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.
If we were ever to introduce 3rd party checks, it would be an extra arm here.