Skip to content

Clippy subtree update #145749

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 137 commits into from
Aug 22, 2025
Merged

Clippy subtree update #145749

merged 137 commits into from
Aug 22, 2025

Conversation

flip1995
Copy link
Member

samueltardieu and others added 30 commits May 16, 2025 17:20
This is necessary in order to use type analysis in later commits.
Suggesting to remove `*&` or `*&mut` in a macro may be incorrect, as it
would require tracking all possible macro usages. In some cases, it is
not possible to remove the dereference or the reference.

For example, in the following code, the `drmut!()` macro will be linted
against while called as `drmut!(d)`, and the suggestion would be to
remove the `*&mut`. That would make `drmut!(u.data).num = 1` invalid,
as a `ManuallyDrop` object coming through a union cannot be implicitely
dereferenced through `DerefMut`.

```rust
use std::mem::ManuallyDrop;

#[derive(Copy, Clone)]
struct Data {
    num: u64,
}

union Union {
    data: ManuallyDrop<Data>,
}

macro_rules! drmut {
    ($e:expr) => { *&mut $e };
}

fn f(mut u: Union, mut d: Data) {
    unsafe {
        drmut!(u.data).num = 1;
    }
    drmut!(d).num = 1;
}
```
changelog: none

Signed-off-by: Zihan <[email protected]>
A type with escaping bound vars cannot be wrapped in a dummy binder
during size computation.
Minor optimization to avoid deallocating/reallocating a new `Vec` in the
top `check_doc` loop.

changelog: none

r? blyxyas
makes the suggestion a bit more legible
…-lang#15436)

fixes rust-lang/rust-clippy#8817

changelog: [`eta_reduction`]: don't refer to ADT constructors as
"function"s
…-lang#15403)

changelog: [`crosspointer_transmute`]: move from `complexity` to
`suspicious`

this looks to me like an obvious miscategorisation -- and there was
already [a proposal to move the
lint](rust-lang/rust-clippy#6626 (comment))
This is a small thing I noticed while looking into
rust-lang/rust-clippy#8014. Since I ultimately
decided not to change the code as a response to the issue, I'm now left
with this one commit, and I feel a bit unsure about making a PR just for
that. This is a problem I have relatively often, so I'd like to know
whether I should to batch these small changes somehow, or whether these
small PRs are fine after all

changelog: none
allows removing the `#[allow(clippy::too_many_lines)]`
@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. labels Aug 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2025

⚠️ Warning ⚠️

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 22, 2025

📌 Commit 9a348e8 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 Aug 22, 2025
@Manishearth
Copy link
Member

@bors p=1 rollup=never

@bors
Copy link
Collaborator

bors commented Aug 22, 2025

⌛ Testing commit 9a348e8 with merge d20509c...

@bors
Copy link
Collaborator

bors commented Aug 22, 2025

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 22, 2025
@bors bors merged commit d20509c into rust-lang:master Aug 22, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 22, 2025
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 f5703d5 (parent) -> d20509c (this PR)

Test differences

Show 4 test diffs

4 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 d20509c2a0c71b60aa2b51566e4d14920e8a1661 --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-aarch64-linux: 6106.0s -> 8599.2s (40.8%)
  2. dist-x86_64-apple: 6907.5s -> 8069.0s (16.8%)
  3. aarch64-gnu-llvm-19-1: 3757.9s -> 3301.5s (-12.1%)
  4. pr-check-1: 1539.3s -> 1389.7s (-9.7%)
  5. pr-check-2: 2332.8s -> 2140.6s (-8.2%)
  6. x86_64-gnu-tools: 3677.8s -> 3381.2s (-8.1%)
  7. x86_64-gnu-miri: 4958.9s -> 4568.7s (-7.9%)
  8. dist-various-1: 3954.4s -> 4257.2s (7.7%)
  9. x86_64-gnu-llvm-20-1: 3501.9s -> 3265.7s (-6.7%)
  10. aarch64-gnu-llvm-19-2: 2347.5s -> 2190.1s (-6.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 (d20509c): comparison URL.

Overall result: ✅ improvements - 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.8%, -0.4%] 8
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (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)
- - 0
Improvements ✅
(secondary)
-5.0% [-5.0%, -5.0%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary -0.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)
2.9% [2.9%, 2.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.1% [-3.1%, -3.1%] 1
All ❌✅ (primary) - - 0

Binary size

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.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 466.339s -> 468.202s (0.40%)
Artifact size: 378.27 MiB -> 378.26 MiB (-0.00%)

@lqd
Copy link
Member

lqd commented Aug 22, 2025

@flip1995 @Manishearth I think the profile changes in clippy's Cargo.toml are impacting the root Cargo.toml, and emitting warnings when cargo is invoked in the repo, e.g. by bootstrap:

warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   ./src/tools/clippy/Cargo.toml
workspace: ./Cargo.toml

These can also be seen in the CI logs, and in our beautiful log viewer.

samueltardieu added a commit to samueltardieu/rust that referenced this pull request Aug 23, 2025
Remove profile section from Clippy

To avoid workspace warnings.

[This](rust-lang#145749) subtree sync started causing warnings in Rust builds (rust-lang#145777) because of the `profile` section in Clippy's `Cargo.toml` file. This profile section was added in rust-lang/rust-clippy#13408 last year, and since it also caused issues then, it was later reverted. However, this change recently reappeared in [this commit](rust-lang/rust-clippy@90364dd), so it is again causing issues for rust-lang/rust.

This PR removes the profile section again.

Fixes: rust-lang#145777
samueltardieu added a commit to samueltardieu/rust that referenced this pull request Aug 23, 2025
Remove profile section from Clippy

To avoid workspace warnings.

[This](rust-lang#145749) subtree sync started causing warnings in Rust builds (rust-lang#145777) because of the `profile` section in Clippy's `Cargo.toml` file. This profile section was added in rust-lang/rust-clippy#13408 last year, and since it also caused issues then, it was later reverted. However, this change recently reappeared in [this commit](rust-lang/rust-clippy@90364dd), so it is again causing issues for rust-lang/rust.

This PR removes the profile section again.

Fixes: rust-lang#145777
samueltardieu added a commit to samueltardieu/rust that referenced this pull request Aug 23, 2025
Remove profile section from Clippy

To avoid workspace warnings.

[This](rust-lang#145749) subtree sync started causing warnings in Rust builds (rust-lang#145777) because of the `profile` section in Clippy's `Cargo.toml` file. This profile section was added in rust-lang/rust-clippy#13408 last year, and since it also caused issues then, it was later reverted. However, this change recently reappeared in [this commit](rust-lang/rust-clippy@90364dd), so it is again causing issues for rust-lang/rust.

This PR removes the profile section again.

Fixes: rust-lang#145777
rust-timer added a commit that referenced this pull request Aug 24, 2025
Rollup merge of #145781 - Kobzol:clippy-remove-profile, r=lqd

Remove profile section from Clippy

To avoid workspace warnings.

[This](#145749) subtree sync started causing warnings in Rust builds (#145777) because of the `profile` section in Clippy's `Cargo.toml` file. This profile section was added in rust-lang/rust-clippy#13408 last year, and since it also caused issues then, it was later reverted. However, this change recently reappeared in [this commit](rust-lang/rust-clippy@90364dd), so it is again causing issues for rust-lang/rust.

This PR removes the profile section again.

Fixes: #145777
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 24, 2025
Remove profile section from Clippy

To avoid workspace warnings.

[This](rust-lang/rust#145749) subtree sync started causing warnings in Rust builds (rust-lang/rust#145777) because of the `profile` section in Clippy's `Cargo.toml` file. This profile section was added in rust-lang/rust-clippy#13408 last year, and since it also caused issues then, it was later reverted. However, this change recently reappeared in [this commit](rust-lang/rust-clippy@90364dd), so it is again causing issues for rust-lang/rust.

This PR removes the profile section again.

Fixes: rust-lang/rust#145777
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. T-clippy Relevant to the Clippy team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.