Skip to content
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

Update Clippy #85954

Merged
merged 77 commits into from
Jun 4, 2021
Merged

Update Clippy #85954

merged 77 commits into from
Jun 4, 2021

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Jun 3, 2021

Bi-weekly Clippy update.

r? @Manishearth

flip1995 and others added 30 commits May 20, 2021 13:07
This speeds up the metadata collection by 2-2.5x on my machine. During
metadata collection other lint passes don't have to be registered, only
the lints themselves.
Early return from LintPass registration when collecting metadata

This speeds up the metadata collection by 2-2.5x on my machine. During
metadata collection other lint passes don't have to be registered, only
the lints themselves.

cc rust-lang#7172

r? `@xFrednet`

changelog: none
The spans given for derived traits used to not indicate they were from a macro expansion.
Suggest changing usages of ref bindings to match the new type
Split out some cases into new lint `ref_binding_to_reference`
…hearth

Updated years in copyrigths

This PR just updates years in copyrights, nothing more.

changelog: none
fix `needless_borrow` suggestion

fixes: rust-lang#2610

While I'm working on this, should needless_borrow be split into two? One lint for expressions and another for patterns. In expression it only lints when the compiler inserts a dereference, but for patterns it's whenever a double reference is created. I think at least the case where a double reference is needed should be split into a new lint as it's not 'needless', it can just be done without a ref binding.

For illustration:

```rust
fn foo(x: &&str) {}

match Some("test") {
    // ref binding is useless here
    Some(ref x) => *x,
    _ => (),
}

match Some("test") {
    // ref binding is useless here
    Some(ref x) => x.len(),
    _ => (),
}

match Some("test") {
    // double reference is needed, but could be `Some(x) => foo(&x)`
    Some(ref x) => foo(x),
    _ => (),
}
```

changelog: Improve the suggestion for `needless_borrow` in patterns to change all usage sites as needed.
changelog: Add lint `ref_binding_to_reference`
Move `needless_borrow` to style

fixes: rust-lang#3742

rust-lang#7105 should be merged first to fix the false positive.

changelog: move `needless_borrow` from `nursery` to `style`
Fix `redundant_closure` for `vec![]` macro in a closure with arguments

fixes: rust-lang#7224
changelog: Fix `redundant_closure` for `vec![]` macro in a closure with arguments
…_trait, r=llogiq

Fix invalid syntax in `from_iter_instead_of_collect` suggestion

First attempt at contributing, hopefully this is a good start and can be improved. :)

fixes rust-lang#7259

changelog: [`from_iter_instead_of_collect`] fix invalid suggestion involving "as Trait"
…-lparam, r=giraffate

Allow wparam and lparam in similar_names

`wparam` and `lparam` are often used as generic parameter names in win32 (for example [WindowProc](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms633573(v=vs.85))). This PR adds them to the similar_names exception list.

changelog: [`similar_names`] don't treat wparam and lparam as similar
…fate

Downgrade suspicious_op..._groupings to Nursery

This addresses rust-lang#6722.

changelog: Downgrade [`suspicious_lint_operations`] to Nursery
…shearth

Some SpanlessHash improvements

changelog: none

* Use `mem::discriminant().hash()` instead of `stable_hash` for simple enums and then use `FxHasher` instead of `StableHasher`. We don't use any StableHash features.
* Use `UnHashMap` for maps keyed by spanless hash values.
@rust-highfive
Copy link
Collaborator

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 3, 2021
@flip1995
Copy link
Member Author

flip1995 commented Jun 3, 2021

@bors rollup=iffy (contains Cargo.lock update)

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 3, 2021

📌 Commit 647f2b4 has been approved by Manishearth

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2021
@bors
Copy link
Contributor

bors commented Jun 3, 2021

⌛ Testing commit 647f2b4 with merge c9c96e4e19422c4c31598b653b8fa7d1b5fb0673...

@bors
Copy link
Contributor

bors commented Jun 3, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 3, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@flip1995
Copy link
Member Author

flip1995 commented Jun 3, 2021

"This check failed" without any message. Seems spurious.

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2021
@bors
Copy link
Contributor

bors commented Jun 4, 2021

⌛ Testing commit 647f2b4 with merge 1c82bb2...

@bors
Copy link
Contributor

bors commented Jun 4, 2021

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 1c82bb2 to master...

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.