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

Clippy subtree update #136645

Merged
merged 75 commits into from
Feb 7, 2025
Merged

Clippy subtree update #136645

merged 75 commits into from
Feb 7, 2025

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Feb 6, 2025

smoelius and others added 30 commits December 29, 2024 07:44
Counting in bytes for a pointer to `u8` is legitimate and must not
trigger the lint. Also, this prevents linting the
`{std,core}::ptr::write_bytes` as it manipulates bytes.
changelog: [`needless_option_take`]: add autofix
…estion (rust-lang#13990)

fix rust-lang#13959

The current implementation of the `write_literal` and `print_literal`
lint performs escaping for the second argument of `write!` ,`writeln!`,
`print!` and `println!` of the suggestion by first replacing `"` with
`\"`, and then replacing `\` with `\\`. Performing these replacements in
this order may lead to unnecessary backslashes being added if the
original code contains `"` (e.g. `"` -> `\\"`), potentially resulting in
a suggestion that causes the code to fail to compile.
In the issue mentioned above, it’s suggested to use raw strings as raw
strings, but implementing this would require an ad-hoc change to the
current implementation, so it has been deferred. (I'll implement this in
another PR)

changelog: [`write_literal`]: fix incorrect escaping of suggestions
changelog: [`print_literal`]: fix incorrect escaping of suggestions
…#13894)

Closes rust-lang#11434 by moving `format_push_string` and `format_collect` to
pedantic.

changelog: Move `format_push_string` and `format_collect` to pedantic
…d-in-new-solver, r=lcnr

Do not consider child bound assumptions for rigid alias

r? lcnr

See first commit for the important details. For second commit, I also stacked a somewhat opinionated name change, though I can separate that if needed.

Fixes rust-lang/trait-system-refactor-initiative#149
Refactor FnKind variant to hold &Fn

Pulling the change suggested in rust-lang#128045 to reduce the impact of changing `Fn` item.

r? `@oli-obk`
Removing the semicolon of the last statement of an expressionless block
may change the block type even if the statement's type is `()`. If the
block type is `!` because of a systematic early return, typing it as
`()` may make it incompatible with the expected type for the block (to
which `!` is cast).
changelog: [`redundant_else`]: autofix for some cases

`redundant_else` can be fixed automatically.
…-lang#14105)

Fix rust-lang#14096

changelog: [`redundant_closure_for_method_calls`]: repeat generic args
in suggestion
Commit 2550530 has extended the
`precedence` lint to include bitmasking and shift operations. The lint
is warn by default, and this generates many hits, especially in embedded
or system code, where it is very idiomatic to use expressions such as
`1 << 3 | 1 << 5` without parentheses.

This commit splits the recent addition into a new lint, which is put
into the "restriction" category, while the original one stays in
"complexity", because mixing bitmasking and arithmetic operations is
less typical.
Co-authored-by: FedericoBruzzone <[email protected]>
Turns out I was completely overcomplicating myself,
there was no need for an external tool such as becnhv2
or even the original becnh, we already had the benchmarking
infrastructure right under our noses!

This PR implements a new **lintcheck** option called
--perf, using it as a flag will mean that lintcheck
builds Clippy as a release package and hooks perf to it.

The realization that lintcheck is already 90% of what
a benchmarking tool needs came to me in a dream.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 6, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@Manishearth
Copy link
Member

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Feb 6, 2025

📌 Commit daa82a1 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 Feb 6, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 6, 2025
…Manishearth

Clippy subtree update

r? `@Manishearth`
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#133925 (disallow `repr()` on invalid items)
 - rust-lang#135549 (Document some safety constraints and use more safe wrappers)
 - rust-lang#136069 (Simplify slice indexing in next trait solver)
 - rust-lang#136152 (Stabilize `map_many_mut` feature)
 - rust-lang#136219 (Misc. `rustc_hir` cleanups 🧹)
 - rust-lang#136580 (Couple of changes to run rustc in miri)
 - rust-lang#136636 (Couple of minor cleanups to the diagnostic infrastructure)
 - rust-lang#136645 (Clippy subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133925 (disallow `repr()` on invalid items)
 - rust-lang#136069 (Simplify slice indexing in next trait solver)
 - rust-lang#136152 (Stabilize `map_many_mut` feature)
 - rust-lang#136219 (Misc. `rustc_hir` cleanups 🧹)
 - rust-lang#136580 (Couple of changes to run rustc in miri)
 - rust-lang#136636 (Couple of minor cleanups to the diagnostic infrastructure)
 - rust-lang#136645 (Clippy subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133925 (disallow `repr()` on invalid items)
 - rust-lang#136069 (Simplify slice indexing in next trait solver)
 - rust-lang#136152 (Stabilize `map_many_mut` feature)
 - rust-lang#136219 (Misc. `rustc_hir` cleanups 🧹)
 - rust-lang#136580 (Couple of changes to run rustc in miri)
 - rust-lang#136636 (Couple of minor cleanups to the diagnostic infrastructure)
 - rust-lang#136645 (Clippy subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b1be2d5 into rust-lang:master Feb 7, 2025
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
Rollup merge of rust-lang#136645 - flip1995:clippy-subtree-update, r=Manishearth

Clippy subtree update

r? `@Manishearth`
@rustbot rustbot added this to the 1.86.0 milestone Feb 7, 2025
carolynzech added a commit to carolynzech/kani that referenced this pull request Feb 10, 2025
- clippy subtree update, c.f. rust-lang/rust#136645
carolynzech added a commit to carolynzech/kani that referenced this pull request Feb 10, 2025
- clippy subtree update, c.f. rust-lang/rust#136645
github-merge-queue bot pushed a commit to model-checking/kani that referenced this pull request Feb 11, 2025
Upgrade toolchain to 2/10.

I **highly recommend** reviewing this PR commit-by-commit. The
description in each commit message links to the upstream PRs that
prompted those particular changes.

## Callouts
- 2/1 had a lot of formatting changes. I split the commits for that day
into formatting changes and functionality changes accordingly.
- 2/5 introduced a regression in our delayed UB instrumentation, so I
made a new fixme test. See #3881 for details.


## Culprit PRs:
rust-lang/rust#134424 
rust-lang/rust#130514
rust-lang/rust#135748
rust-lang/rust#136590
rust-lang/rust#135318
rust-lang/rust#135265

rust-lang/rust@bcb8565
rust-lang/rust#136471
rust-lang/rust#136645

Resolves #3863

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 20, 2025
…Manishearth

Clippy subtree update

r? `@Manishearth`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.