Skip to content

Update Clippy #105140

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 121 commits into from
Dec 2, 2022
Merged

Update Clippy #105140

merged 121 commits into from
Dec 2, 2022

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Dec 1, 2022

fkohlgrueber and others added 30 commits March 12, 2019 13:38
Certain types must be enclosed in angle brackets and must have generic
arguments substituted to create a working suggestion. For example, if
`s` has type `&[u8]`, then `|s| s.len()` may be replaced with
`<[u8]>::len`. Previously, Clippy erroneously suggested `[T]::len`.
…redicate, r=lcnr

Add `PolyExistentialPredicate` type alias

Wrapping `ExistentialPredicate`s in a binder is very common, and this alias already exists for the `PolyExistential{TraitRef,Projection}` types.
…lally allow trait resolution to prove false things during coherence
Add new lint  [`misnamed-getters`]

```
changelog: Add new lint  [`misnamed-getters`]
```

Closes rust-lang#9769

The current lint matches all methods with a body of just one expression under the form `(&mut?)? <expr>.field` where field doesn't match the name of the method but there is a field of the same type in `<expr>` that matches the name. This allows matching nested structs, for example for newtype wrappers. This may cast the net a bit too wide and cause false positives. I'll run [clippy_lint_tester](https://github.com/mikerite/clippy_lint_tester) on the top crates to see how frequently false positives happen.

There also may be room for improvement by checking that the replacement field would work taking into account implementations of `Deref` and `DerefMut` even if the types don't exactly match but I don't know yet how this could be done.
xFrednet and others added 17 commits November 30, 2022 12:59
…ip1995

Move `unnecessary_unsafety_doc` to `pedantic`

This lint was added in rust-lang#9822. I like the idea, but also agree with rust-lang#9986 as well. I think it should at least not be warn-by-default. This is one of these cases, where I'd like a group between pedantic and restriction. But I believe that users using `#![warn(clippy::pedantic)]` will know how to enable the lint if they disagree with it.

---

Since the lint is new:

changelog: none

r? `@flip1995` since I'd suggest back porting this, the original PR was merged 16 days ago.

Closes: rust-lang#9986 (While it doesn't address everything, I believe that this is the best compromise)
Don't cross contexts while building the suggestion for `redundant_closure_call`

fixes rust-lang#9957

changelog: `redundant_closure_call`: Don't cross macro contexts while building the suggestion
Don't lint `explicit_auto_deref` when the initial type is neither a reference, nor a receiver

fixes rust-lang#9901
fixes rust-lang#9777
changelog: `explicit_auto_deref`: Don't lint when the initial value is neither a reference, nor a receiver
Fix `unnecessary_cast` suggestion when taking a reference

fixes rust-lang#9906
changelog: `unnecessary_cast`: Fix suggestion when taking a reference
Fix ICE in `unused_rounding`

fixes rust-lang#9866
changelog: `unused_rounding`: Fix ICE when using the `_` separator
manual_let_else: keep macro call on suggestion blocks

Closes rust-lang#9940

changelog: [`manual_let_else`]: Do not expand macro calls on suggestions
Fix ICE in `result_large_err` with uninhabited enums

fixes rust-lang#10005
changelog: `result_large_err`: Fix ICE with uninhabited enums
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 1, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 1, 2022

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@Manishearth
Copy link
Member

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Dec 1, 2022

📌 Commit ebf5799 has been approved by Manishearth

It is now in the queue for this repository.

@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 Dec 1, 2022
@bors
Copy link
Collaborator

bors commented Dec 1, 2022

⌛ Testing commit ebf5799 with merge 56c241c...

@bors
Copy link
Collaborator

bors commented Dec 2, 2022

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 56c241c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 2, 2022
@bors bors merged commit 56c241c into rust-lang:master Dec 2, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 2, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (56c241c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
4.6% [4.6%, 4.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.6% [4.6%, 4.6%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

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.