Skip to content

Clippy subtree update#155996

Merged
rust-bors[bot] merged 69 commits intorust-lang:mainfrom
flip1995:clippy-subtree-update
May 3, 2026
Merged

Clippy subtree update#155996
rust-bors[bot] merged 69 commits intorust-lang:mainfrom
flip1995:clippy-subtree-update

Conversation

@flip1995
Copy link
Copy Markdown
Member

r? Manishearth

zihan0822 and others added 30 commits April 4, 2026 16:16
changelog: new lint: [`inline_modules`]

Signed-off-by: Zihan <zihanli0822@gmail.com>
`span_suggestions` is to provide mutually exclusive suggestions. When it was introduced, we made its behavior be that if a single suggestion is given to it, we present the suggestion inline, otherwise in patch format. Changing this to make all of its uses be verbose, as that is closer in intent of output.
The `Residual` trait was even more experimental than `Try`, but now that RFC3721 is merged, I think it would make sense to require this.
If all the ways to "leave" the closure is through a divergent statement
other than `return` (not detected as a potential return value by the
visitor), do not trigger the lint.
Rollup of 18 pull requests

Successful merges:

 - rust-lang#154451 (Require that a `<_ as Try>::Residual` implement the `Residual` trait)
 - rust-lang#154595 (Emit fatal on invalid const args with nested defs)
 - rust-lang#154599 (report the `varargs_without_pattern` lint in deps)
 - rust-lang#154699 (`core::unicode`: Replace `Cased` table with `Lt`)
 - rust-lang#155353 (resolve: Remove `inaccessible_ctor_reexport` resolver field)
 - rust-lang#155357 (Add `--remap-path-scope` as unstable in rustdoc)
 - rust-lang#150649 (clippy fix: non_canonical_clone_impl)
 - rust-lang#154604 (abort in core)
 - rust-lang#154616 (Add `--quiet` flag to x.py and bootstrap to suppress output)
 - rust-lang#155215 (Clean up `AttributeLintKind` and refactor diagnostic attribute linting)
 - rust-lang#155228 (Check diagnostic output in incremental `cpass` and `rpass` revisions)
 - rust-lang#155266 (Adjust release notes for post-merge feedback)
 - rust-lang#155326 (Disallow ZST allocations with `TypedArena`.)
 - rust-lang#155334 (docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests)
 - rust-lang#155340 (Handle nonnull pattern types in size skeleton)
 - rust-lang#155347 (Add push_mut and new Layout methods to release notes)
 - rust-lang#155356 (remove calls to AliasTyKind::def_id)
 - rust-lang#155364 (Reduce diagnostic type visibilities.)
…lang#16867)

If all the ways to "leave" the closure is through a divergent statement
other than `return` (not detected as a potential return value by the
visitor), do not trigger the lint.

changelog: [`bind_instead_of_map`]: do not propose to rewrite the
expression if the only way to leave the closure is through a divergent
statement other than `return`

Fixes rust-lang/rust-clippy#16861
minor code cleanup getting ready for the `useless_borrows_in_formatting`
lint
minor code cleanup getting ready for the `useless_borrows_in_formatting`
lint

See rust-lang/rust-clippy#16523

r? @samueltardieu

---

changelog: none
Only curl and stacker still depends on it.
Detect format macros where an argument
is passed with an explicit `&` even though the formatter already takes
references, e.g. `println!("{}", &s)` when `s: &str`.

Some original micro-benchmarks showed ~6% performance improvement when redundant refs are removed.

- Lint runs for both Display (`{}`) and Debug (`{:?}`) placeholders when
  the inner type is Sized and implements the corresponding trait.
- Applies to the main value argument and to width/precision arguments
  (e.g. `format!("{0:1$.2$}", &v1, &v2, &v3)`).
- Suggests removing the redundant `&` with MachineApplicable fix.
- Skip when the argument comes from expansion or a proc macro.
…nishearth

Clippy subtree update

r? Manishearth 

`Cargo.lock` update due to Clippy version bump and cargo_metadata dep bump in Clippy.
Co-authored-by: Samuel Tardieu <sam@rfc1149.net>
Refactor FnDecl and FnSig non-type fields into a new wrapper type





#### Why this Refactor?

This PR is part of an initial cleanup for the [arg splat experiment](rust-lang#153629), but it's a useful refactor by itself.

It refactors the non-type fields of `FnDecl`, `FnSig`, and `FnHeader` into a new packed wrapper types, based on this comment in the `splat` experiment PR:
rust-lang#153697 (comment)

It also refactors some common `FnSig` creation settings into their own methods. I did this instead of creating a struct with defaults.

#### Relationship to `splat` Experiment

I don't think we can use functional struct updates (`..default()`) to create `FnDecl` and `FnSig`, because we need the bit-packing for the `splat` experiment.

Bit-packing will avoid breaking "type is small" assertions for commonly used types when `splat` is added.
This PR packs these types:
- ExternAbi: enum + `unwind` variants (38) -> 6 bits
- ImplicitSelfKind: enum variants (5) -> 3 bits
- lifetime_elision_allowed, safety, c_variadic: bool -> 1 bit

#### Minor Changes

Fixes some typos, and applies rustfmt to clippy files that got skipped somehow.
*[View all
comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust-clippy/pull/16523)*

Fixes rust-lang/rust-clippy#10851

This is a workaround for the current [compiler
limitation](rust-lang#112156) that
results in a ~6% performance degradation.

This lint detects format macros where an argument is passed with an
explicit `&` references, e.g. `println!("{}", &s)`

- Lint runs for both Display (`{}`) and Debug (`{:?}`) placeholders when
the inner type is Sized and implements the corresponding trait.
- Applies to the main value argument and to width/precision arguments
(e.g. `format!("{0:1$.2$}", &v1, &v2, &v3)`).
- Suggests removing the redundant `&` with MachineApplicable fix.
- Skip when the argument comes from expansion or a proc macro.

changelog: [`useless_borrows_in_formatting`]: detect redundant `&` in
format macro arguments

P.S. I think this lint should go into `perf` category once the code is
reviewed
Warn when a format width is less than the minimum output size for the
format trait (e.g. `{:#02x}` yields "0x1", so width 2 is ignored).
Help suggests removing the width or increasing it above the minimum.
Update a bunch of dependencies to reduce windows-sys duplication

This gets rid of windows-sys 0.60 and with the exception of curl and stacker it gets rid of windows-sys 0.59. For stacker getting rid of windows-sys 0.59 is blocked on rust-lang/stacker#145 and rust-lang#155438.
…=lcnr

Introduce `Unnormalized` wrapper




This is the first step of the [eager normalization](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/Eager.20normalization.2C.20ahoy.21/with/582996293) series.

This PR introduce an `Unnormalized` wrapper and make most normalization routines consume it. The purpose is to make normalization explicit. 
This PR contains no behavior change.

API changes are in the first two commit. 
There're some normalization routines left untouched:
- `normalize` in the type checker of borrowck: better do it together with `field.ty()` returning `Unnormalized`.
- `normalize_with_depth`: only used inside the old solver. Can be done later.
- `query_normalize`: rarely used.
- misc local normalization helpers.

The compiler errors are mostly fixed via `ast-grep`, with exceptions handled manually.
Closes rust-lang/rust-clippy#16822

changelog: [`for_kv_map`] fix FN when using `iter` and `iter_mut`
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 30, 2026

📌 Commit c9aa8af 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 30, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job dist-x86_64-msvc failed! Check out the build log: (web) (plain enhanced) (plain)

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

@rust-bors rust-bors Bot 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 May 1, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

💔 Test for d4059a1 failed: CI. Failed job:

@matthiaskrgr
Copy link
Copy Markdown
Member

@bors retry

@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 May 1, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test expr_store::scope::tests::test_shadow_variable ... ok
test expr_store::tests::body::array_element_cfg ... ok
test expr_store::tests::body::async_fn_weird_param_patterns ... ok
test expr_store::tests::body::block::inner_item_smoke ... ok
error: test failed, to rerun pass `-p hir-def --lib`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/hir_def-c439368f2b64a049 '--skip=tests::smoke_test_real_sysroot_cargo' --skip=check_code_formatting -Z unstable-options --format json` (signal: 11, SIGSEGV: invalid memory reference)
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Build completed unsuccessfully in 0:59:57
  local time: Fri May  1 22:41:08 UTC 2026
  network time: Fri, 01 May 2026 22:41:08 GMT
##[error]Process completed with exit code 1.

@rust-bors rust-bors Bot 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 May 1, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

💔 Test for 4ea876a failed: CI. Failed job:

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Spurious
@bors retry

@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 May 3, 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 May 3, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 3, 2026

☀️ Test successful - CI
Approved by: Manishearth
Duration: 3h 16m 2s
Pushing 54f67d2 to main...

@rust-bors rust-bors Bot merged commit 54f67d2 into rust-lang:main May 3, 2026
12 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

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 6769f69 (parent) -> 54f67d2 (this PR)

Test differences

Show 2 test diffs

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

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 54f67d248b14af80be8f3adc2094dd4a84ec2115 --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-msvc-ext2: 1h 27m -> 1h 58m (+36.3%)
  2. dist-aarch64-linux: 1h 54m -> 2h 34m (+35.1%)
  3. dist-i686-linux: 1h 27m -> 1h 54m (+30.3%)
  4. i686-gnu-2: 1h 40m -> 1h 10m (-29.8%)
  5. x86_64-gnu-llvm-21: 1h 21m -> 59m 12s (-27.2%)
  6. dist-aarch64-apple: 2h 12m -> 1h 38m (-25.4%)
  7. dist-various-2: 34m 54s -> 42m 36s (+22.0%)
  8. x86_64-gnu-distcheck: 1h 51m -> 2h 15m (+20.8%)
  9. dist-s390x-linux: 1h 31m -> 1h 13m (-19.7%)
  10. dist-android: 28m 26s -> 22m 59s (-19.2%)
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 (54f67d2): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

Results (secondary -1.1%)

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)
- - 0
Improvements ✅
(secondary)
-1.1% [-2.3%, -0.5%] 3
All ❌✅ (primary) - - 0

Cycles

Results (secondary 0.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.7% [0.5%, 1.0%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.0% [-1.4%, -0.5%] 2
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 503.61s -> 494.817s (-1.75%)
Artifact size: 394.46 MiB -> 394.41 MiB (-0.01%)

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.