-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Update Clippy #78774
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
Update Clippy #78774
Conversation
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
The items_after_statements lint was skipping all expansions. Instead we should still lint local macros. Fixes rust-lang#578
…p_unwrap_or` lints
Co-authored-by: Philipp Krones <[email protected]>
Co-authored-by: Philipp Krones <[email protected]>
Co-authored-by: Philipp Krones <[email protected]>
Co-authored-by: Philipp Krones <[email protected]>
fix the error-causing suggestion of 'borrowed_box', which missed parentheses and was ambiguous.
…r=flip1995 Add lint: from_iter_instead_of_collect Fixes rust-lang#5679 This implements lint for `::from_iter()` from rust-lang#5679 not the general issue (`std::ops::Add::add`, etc.). This lint checks if expression is function call with `from_iter` name and if it's implementation of the `std::iter::FromIterator` trait. changelog: Introduce from_iter_instead_of_collect lint
Add lint 'ref_option_ref' rust-lang#1377 This lint checks for usage of `&Option<&T>` which can be simplified as `Option<&T>` as suggested in rust-lang#1377. This WIP PR is here to get feedback on the lint as there's more cases to be handled: * statics/consts, * associated types, * type alias, * function/method parameter/return, * ADT definitions (struct/tuple struct fields, enum variants) changelog: Add 'ref_option_ref' lint
add manual_ok_or lint Implements partially rust-lang#5923 changelog: add lint manual_ok_or
…e_disable, r=flip1995 Clarify allow/warn/deny documentation. Remove enable/disable. Disable and enable when not specifically explained were not clear to me as an English language speaker, but I was able to figure it out fairly easily due to the examples having A/W, which I assumed meant `allow` and `warn`. I removed both words to be sure it was clear as well as extending the note on what deny means. It now includes a statement on exactly what each word means. Documentation only update. *Please keep the line below* changelog: none
Use const sym where possible I ran a regex search and replace to use const `sym` values where possible. This should give some performance boost by avoiding string interning at runtime. Con: It is not as consistent as always using `sym!`. I also changed an internal lint to suggest using `sym::{}`, making an assumption that this will always work for diagnostic items. changelog: none
Rustup changelog: none r? `@ghost`
Add lint for 'field_reassign_with_default` rust-lang#568 changelog: Add lint for field_reassign_with_default that checks if mutable object + field modification is used to edit a binding initialized with Default::default() instead of struct constructor. Fixes rust-lang#568 Notes: - Checks for reassignment of one or more fields of a binding initialized with Default::default(). - Implemented using EarlyLintPass, might be future proofed better with LateLintPass. - Does not trigger if Default::default() is used via another type implementing Default. - This is a re-open of [PR#4761](rust-lang/rust-clippy#4761), but I couldn't figure out how to re-open that one so here's a new one with the requested changes :S
…in_unused_unit, r=ebroto Fix suggestion to add unneeded space in `unused_unit` Fix rust-lang/rust-clippy#6230 changelog: Fix suggestion to add unneeded space in `unused_unit`
…r=nikomatsakis Provide diagnostic suggestion in ExprUseVisitor Delegate The [Delegate trait](https://github.com/rust-lang/rust/blob/981346fc07dd5ef414c5b1b21999f7604cece006/compiler/rustc_typeck/src/expr_use_visitor.rs#L28-L38) currently use `PlaceWithHirId` which is composed of Hir `Place` and the corresponding expression id. Even though this is an accurate way of expressing how a Place is used, it can cause confusion during diagnostics. Eg: ``` let arr : [String; 5]; let [a, ...] = arr; ^^^ E1 ^^^ = ^^E2^^ ``` Here `arr` is moved because of the binding created E1. However, when we point to E1 in diagnostics with the message `arr` was moved, it can be confusing. Rather we would like to report E2 to the user. Closes: rust-lang/project-rfc-2229#20 r? `@ghost`
Rustup r? `@ghost` changelog: none
@bors r+ p=1 |
📌 Commit 46c714f has been approved by |
☀️ Test successful - checks-actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merged-by-bors
This PR was explicitly merged by bors.
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
Biweekly Clippy update
r? @Manishearth