Skip to content

Clippy subtree update#152862

Merged
rust-bors[bot] merged 101 commits intorust-lang:mainfrom
flip1995:clippy-subtree-update
Feb 25, 2026
Merged

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

Conversation

@flip1995
Copy link
Member

@flip1995 flip1995 commented Feb 19, 2026

View all comments

r? Manishearth

ada4a and others added 30 commits October 7, 2025 16:46
We might not have the declaration around if `extern crate` is used, or if
rust-src is not installed for the standard library. Better err on the safe
side rather than having a behavior depending on what happens to be available
at compile time.
Fixes a FP for assertions_on_result_states, missing_assert_message
on edition 2015/2018
Co-authored-by: Michael Goulet <michael@errs.io>
)

Closes rust-lang/rust-clippy#16515

changelog: [`iter_kv_map`] extend to cover `flat_map` and `filter_map`
The `RustcCallbacks::config()` function used by `clippy-driver` was not
setting `config.extra_symbols`, so when interned symbols were computed,
such as `sym::CLIPPY_ARGS`, it was using some random string in the
binary. The fix is to set 

```rust
config.extra_symbols = sym::EXTRA_SYMBOLS.into();
```

in the config() function. This mirrors what is done in the
`ClippyCallbacks::config()` function, which did not show a problem.

# Steps to repro the problem (WITHOUT this PR):

I'm on a mac laptop now, but I repro'd this on Linux too:

```console
❯ cargo -V
cargo 1.95.0-nightly (fe2f314ae 2026-01-30)
```

1. Create a dummy project
```console
❯ cargo new --lib /tmp/foo
```

2. Run `clippy-driver` from this repo on `/tmp/foo/src/lib.rs`. You must
   specify `--cap-lints allow` in order for the `RustcCallbacks` to be
   used; otherwise, the `ClippyCallbacks` are used ad you won't see the
   problem.
```console
❯ cargo run --bin clippy-driver -- rustc --crate-name foo --edition=2024 /tmp/foo/src/lib.rs --crate-type lib --emit=dep-info --out-dir /tmp/foo --cap-lints allow
```

3. **The problem**: The problem is the `env-dep:macos` line. It is
   _incorrectly_ recording that the "macos" environment varialbe is
   relevant for this build. On Linux it showed the string "linux". I've
   also seen other random strings, like "128". I believe these strings
   are arbitrary.

   The problem is that the `sym::CLIPPY_ARGS` symbol is read without the
   `exta_symbols` table being set.
```console
❯ cat /tmp/foo/foo.d
/tmp/foo/foo.d: /tmp/foo/src/lib.rs

/tmp/foo/src/lib.rs:

# env-dep:macos
```

# The fix:

With this fix in this PR, we can re-run the `clippy-driver` invocation
in step 2 above and see the expected dep-info showing
`env-dep:CLIPPY_ARGS` instead of `env-dep:macos`.

```console

❯ cargo run --bin clippy-driver -- rustc --crate-name foo --edition=2024 /tmp/foo/src/lib.rs --crate-type lib --emit=dep-info --out-dir /tmp/foo --cap-lints allow

❯ cat /tmp/foo/foo.d
/tmp/foo/foo.d: /tmp/foo/src/lib.rs

/tmp/foo/src/lib.rs:

# env-dep:CLIPPY_ARGS
```
…ting to a path that's distinct from `target-dir`.
…g#16415)

We might not have the declaration around if `extern crate` is used, or
if rust-src is not installed for the standard library. Better err on the
safe side rather than having a behavior depending on what happens to be
available at compile time.

Fixes rust-lang/rust-clippy#14625

changelog: [`unnecessary_cast`]: do not warn on casts of external
function return type
…ting to a path that's distinct from `target-dir` (rust-lang#16568)

Fixes rust-lang/rust-clippy#16567.

Fix the compile-test tests when Cargo's `build.build-dir` is set to a
path that's distinct from `target-dir`. Right now, the uitest harness
assumes that `clippy-driver` (a final build artifact) is located in the
parent directory of `compile_test-…` (an intermediate artifact or,
rather, a dependency's final artifact), and that doesn't hold when
`build-dir` is configured independently from `target-dir`, like so (in
~/.cargo/config.toml):

```toml
[build]
build-dir = "{cargo-cache-home}/build-artifacts/{workspace-path-hash}"
```

changelog: none
…ust-lang#16620)

Closes rust-lang/rust-clippy#16612

Previous implementation hardcoded `0` as loop counter start, this PR
lifts that restriction.

changelog: [`explicit_counter_loop`] fix FN when loop counter starts at
non-zero
@flip1995 flip1995 closed this Feb 24, 2026
@flip1995 flip1995 force-pushed the clippy-subtree-update branch from 9d06e5d to 0028f34 Compare February 24, 2026 10:37
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 24, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@flip1995 flip1995 reopened this Feb 24, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 24, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2026

⚠️ Warning ⚠️

@flip1995
Copy link
Member Author

flip1995 commented Feb 24, 2026

Thanks for the investigation! I redid the sync. Conflict resolution was a bit tedious. But now x test src/tools/clippy passes locally.

Let's hope CI agrees.

@rust-log-analyzer

This comment has been minimized.

@samueltardieu
Copy link
Member

@flip1995 If you haven't addressed the failure yet, I have commit 289720f in the clippy-subtree-update branch of samueltardieu/rust which makes x --stage 2 clippy rustc_codegen_gcc pass.

@rustbot
Copy link
Collaborator

rustbot commented Feb 24, 2026

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@flip1995
Copy link
Member Author

Thanks! cherry-picked that commit

.get_target_builtin_function("__builtin_ia32_vfcmaddcsh_mask_round")
.get_address(None);
}
"__builtin_ia32_vfcmaddcsh_mask3_round" if format!("{:?}", args[3]).ends_with("255") => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing the code, could you please add an attribute #[allow(clippy:_)] at the crate root?
I prefer the old code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flip1995 You can drop my previous commit and cherry-pick f3d5af2 instead if you want, verified passing x --stage 2 clippy rustc_codegen_gcc. It allows clippy::collapsible_match.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Whatever you prefer 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f597b0f

uninlined_format_args is marked as expected. I can also change the allow added for this lint to an expect, if you want.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[allow] is OK for this.
Thanks!

@flip1995 flip1995 force-pushed the clippy-subtree-update branch from 295a335 to f597b0f Compare February 24, 2026 14:11
@samueltardieu
Copy link
Member

Previous CI run was green, with only the lint change that should do it, let's roll.

@bors r+ p=1 rollup=never

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 24, 2026

📌 Commit f597b0f has been approved by samueltardieu

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 Feb 24, 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 Feb 25, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 25, 2026

☀️ Test successful - CI
Approved by: samueltardieu
Duration: 3h 33m 17s
Pushing 3f98535 to main...

@rust-bors rust-bors bot merged commit 3f98535 into rust-lang:main Feb 25, 2026
12 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 25, 2026
@github-actions
Copy link
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 58745ca (parent) -> 3f98535 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 3f9853562c73af38a5e6af8b0da1b2734a327e19 --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. dist-x86_64-apple: 2h 5m -> 3h (+43.5%)
  2. dist-apple-various: 1h 32m -> 1h 52m (+21.7%)
  3. pr-check-1: 31m 31s -> 27m 5s (-14.1%)
  4. x86_64-gnu-stable: 2h 23m -> 2h 3m (-14.0%)
  5. armhf-gnu: 1h 29m -> 1h 17m (-13.7%)
  6. aarch64-apple: 3h 57m -> 3h 25m (-13.5%)
  7. aarch64-gnu-debug: 1h 15m -> 1h 6m (-12.5%)
  8. dist-aarch64-llvm-mingw: 1h 47m -> 1h 35m (-11.5%)
  9. x86_64-rust-for-linux: 51m 41s -> 45m 48s (-11.4%)
  10. dist-x86_64-freebsd: 1h 33m -> 1h 23m (-10.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
Collaborator

Finished benchmarking commit (3f98535): 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 (secondary 8.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)
8.1% [8.1%, 8.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 478.569s -> 480.701s (0.45%)
Artifact size: 395.75 MiB -> 397.77 MiB (0.51%)

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.