Skip to content

Clippy subtree update#158403

Merged
rust-bors[bot] merged 130 commits into
rust-lang:mainfrom
flip1995:clippy-subtree-update
Jun 26, 2026
Merged

Clippy subtree update#158403
rust-bors[bot] merged 130 commits into
rust-lang:mainfrom
flip1995:clippy-subtree-update

Conversation

@flip1995

@flip1995 flip1995 commented Jun 25, 2026

Copy link
Copy Markdown
Member

View all comments

r? Manishearth

laffed and others added 30 commits April 16, 2026 14:01
…t suggestion

When suggesting `sort_by_key` for a reversed comparator like  `|a, b|
b.foo.cmp(&a.foo)`, the lint was picking `left_expr` (the  receiver of
`.cmp()`, which references `b`) and `r_pat` as the closure  arg,
producing `|b| Reverse(b.foo)`. Both sides consistently named `b`,  but
`b` is the second parameter — confusing and inconsistent with the
forward-sort suggestion style.  Fix by using `right_expr` (the `.cmp()`
argument, which references `a`)  as the key body and `l_pat` as the
closure parameter, peeling the single  `&` that `.cmp(&rhs)` introduces
so the suggestion doesn't contain a  spurious borrow.
The choice of `std::env::current_dir` made me originally think this was about
file and directory paths - use an item where "path" couldn't mean something
else. `std::f64::consts::PI` was chosen to match the example.
This lint suggests using `as_chunks` or `as_chunks_mut` instead of
`chunks_exact` or `chunks_exact_mut` when called with a constant size.

changelog: new lint: [`chunks_exact_to_as_chunks`]
An explicit type annotation on the LHS (`let _: T = expr`) signals an
intentional discard, mirroring the rationale for `let_underscore_untyped`.
Without this gate, typed bindings such as
`let _: Pin<Box<dyn Future<Output = ()>>> = foo();` trigger the lint
despite the author explicitly opting in.

changelog: [`let_underscore_future`]: no longer triggers when the binding has an explicit type annotation
Signed-off-by: ChrisJr404 <chris@hacknow.com>
…BoxyUwU

remove `IsTypeConst` from `hir::TraitItemKind`

Fixes rust-lang#152940

following up on rust-lang#152940 (comment)

r? @BoxyUwU
Instead of bailing, this changes the lint to handle the return type and
write out the correct result. If the function we're translating into can
handle it, we use a turbofish, since that will influence type inference
but not cause integer truncation. But, if that can't be done, it'll use
`as` and let a future lint take care of that.
| crate | instructions base | instructions new | delta |
|---|---|---|---|
| cargo-0.80.0 (lib) | 29,893,214,650 | 29,726,591,660 | -0.56% |
| cargo-0.80.0 (bin) | 1,631,825,989 | 1,627,901,224 | -0.24% |
| serde-1.0.204 | 7,203,901,010 | 7,167,022,578 | -0.51% |
| tokio-1.38.1 | 522,611,594 | 518,512,971 | -0.78% |
| ryu-1.0.18 | 271,073,171 | 270,569,049 | -0.19% |

changelog: none
- make the comments more specific and useful
- add return-type ascription even if there are params that still prevent
  this from being a machine applicable lint
…s allowed (rust-lang#17217)

Instruction counts (perf stat instructions:u):

| crate | instructions base | instructions new | delta |
|---|---|---|---|
| regex-1.10.5 | 1,010,565,235 | 968,595,926 | -4.15% |
| bumpalo-3.16.0 | 320,518,375 | 313,577,464 | -2.17% |
| tokio-1.38.1 | 522,405,496 | 510,949,744 | -2.19% |
| mdbook-0.4.40 (bin) | 3,475,263,547 | 3,466,707,439 | -0.25% |
| ripgrep-14.1.0 | 1,969,387,093 | 1,957,903,931 | -0.58% |

changelog: none
@rustbot

rustbot commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

@flip1995

flip1995 commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

I don't think this suggestion will make people happy

Nvm. With this suggestion applied, I could remove a arr.try_into().unwrap(). IMO this version is an improvement. But YMMV. So @antoyo , please take a look before we merge this: 6c335ef

@antoyo

antoyo commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Nvm. With this suggestion applied, I could remove a arr.try_into().unwrap(). IMO this version is an improvement. But YMMV. So @antoyo , please take a look before we merge this: 6c335ef

I guess this was already an issue before, but could you please add a debug_assert to make sure the remainder is empty?
Looks good to me otherwise.

@Manishearth

Copy link
Copy Markdown
Member

@bors r+ p=2 rollup=never

@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 6c335ef has been approved by Manishearth

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 6. This pull request will be tested once the tree is reopened.

@rust-bors rust-bors Bot 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 25, 2026
@Manishearth

Copy link
Copy Markdown
Member

@bors r-

r=me after the suggestion is implemented

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 25, 2026
@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

View changes since this unapproval

@flip1995

Copy link
Copy Markdown
Member Author

I guess this was already an issue before, but could you please add a debug_assert to make sure the remainder is empty?

Sure, can do. But that is already guaranteed by the match bytes.len(). Still want me to add the debug_assert?

@antoyo

antoyo commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Sure, can do. But that is already guaranteed by the match bytes.len(). Still want me to add the debug_assert?

Yes please.

@flip1995 flip1995 force-pushed the clippy-subtree-update branch from 6c335ef to 91c04df Compare June 26, 2026 08:33
@flip1995

Copy link
Copy Markdown
Member Author

I amended it to 91c04df, PTAL.

@Manishearth

Copy link
Copy Markdown
Member

@bors r+ p=2

@rust-bors

rust-bors Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 91c04df has been approved by Manishearth

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 26, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 26, 2026
@rust-bors

rust-bors Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: Manishearth
Duration: 3h 22m 52s
Pushing eb6346c to main...

@rust-bors rust-bors Bot merged commit eb6346c into rust-lang:main Jun 26, 2026
14 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 40557f6 (parent) -> eb6346c (this PR)

Test differences

Show 3 test diffs

Stage 2

  • [run-make] tests/run-make/compressed-debuginfo-zstd: ignore (ignored if LLVM wasn't build with zstd for ELF section compression or LLVM is not the default codegen backend) -> pass (J0)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard eb6346c659ccb0468a1477c716ca5450a1fa9ba1 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-gnu-gcc-core-tests: 25m 43s -> 9m 1s (-64.9%)
  2. x86_64-rust-for-linux: 1h 7m -> 28m 8s (-58.2%)
  3. dist-i686-mingw: 2h 3m -> 2h 55m (+41.9%)
  4. dist-powerpc64-linux-musl: 1h 6m -> 1h 31m (+37.4%)
  5. pr-check-1: 44m 3s -> 29m 13s (-33.7%)
  6. pr-check-2: 50m 57s -> 35m 16s (-30.8%)
  7. dist-x86_64-freebsd: 1h 42m -> 1h 11m (-30.5%)
  8. x86_64-gnu-tools: 1h 20m -> 57m 28s (-28.6%)
  9. x86_64-gnu-next-trait-solver-polonius: 1h 15m -> 55m 28s (-27.0%)
  10. x86_64-gnu-gcc: 1h 30m -> 1h 6m (-26.7%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (eb6346c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (secondary 2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Cycles

Results (primary -2.8%, secondary -5.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 482.935s -> 485.381s (0.51%)
Artifact size: 392.98 MiB -> 392.99 MiB (0.00%)

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. T-clippy Relevant to the Clippy team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.