Skip to content

Clippy subtree update - #160692

Merged
rust-bors[bot] merged 229 commits into
rust-lang:mainfrom
flip1995:clippy-subtree-update
Aug 7, 2026
Merged

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

Conversation

@flip1995

@flip1995 flip1995 commented Aug 7, 2026

Copy link
Copy Markdown
Member

r? @samueltardieu

Cargo.lock update due to the removal of the rustc-semver dependency.

Francisco-Andre-Martins and others added 30 commits March 25, 2026 15:56
This fix adds an aditional check, by checking if the previous
element was an image, and ignoring the lack of punctuation
for a subsequent link. An aditional test was added to account
for this case.

Closes rust-lang#16439
The main value of this help text is only provided when the
developer already provided all the fields. So a better example
is showing the developer that this lint can be used to clean
up those struct initalizations.

Besides the lint already points to the ...zero_point line
so the developer is inclined to remove it.
Because of the way this lint implements text splitting, I need to track
markdown and text lengths separately. This is fairly easy, since we can
exhaustively check every markdown event and count the characters inside.
test: supply test for issue 16954.

fix: suggest MethodCall for expr with type anchor.

fix: remove redudant is_lit check.

fix: missing parenthesis for a * b.

fix: remove redundant lit check.
This better matches how the argument is actually used.
See `rustc_hir::intravisit::{walk_expr,walk_pat_expr}`.
Detect `match` expressions where every arm is a block ending in the same
trailing expression and the `match` is in tail position, suggesting the
expression be hoisted out below the `match`.

changelog: [`branches_sharing_code`]: also lint `match` expressions whose
arms end with the same expression
…modes

Implement configuration-based approach with three options:
- alphabetical (default)
- trait_item_ordering
- alphabetical_or_trait_item_ordering

Fixes false positives for non-alphabetically-ordered trait definitions.
…ait_item_ordering` and `alphabetical_or_trait_item_ordering
The `opt.and_then(|x| { /* comment */ if .. { Some(x) } else { None } })`
to `filter` rewrite drops any comment inside the closure. Mark the
suggestion `MaybeIncorrect` when the replaced span contains a comment, so
`clippy --fix` no longer applies it silently. This matches the existing
`span_contains_comment` handling in manual_ok_err / manual_unwrap_or /
manual_flatten.
…ingjubilee

Carry the `b_offset` inside `BackendRepr::ScalarPair`

Inspired by rust-lang/compiler-team#1007 but doesn't actually change any of the layout rules just yet.

This turned out to be a nice change even if we didn't use the extra flexibility, IMHO, because it allowed so many things like

```diff
@@ -222,12 +224,12 @@ fn from_const_alloc<Bx: BuilderMethods<'a, 'tcx, Value = V>>(
                 let val = read_scalar(offset, size, s, bx.immediate_backend_type(layout));
                 OperandRef { val: OperandValue::Immediate(val), layout, move_annotation: None }
             }
-            BackendRepr::ScalarPair(
-                a @ abi::Scalar::Initialized { .. },
-                b @ abi::Scalar::Initialized { .. },
-            ) => {
+            BackendRepr::ScalarPair {
+                a: a @ abi::Scalar::Initialized { .. },
+                b: b @ abi::Scalar::Initialized { .. },
+                b_offset,
+            } => {
                 let (a_size, b_size) = (a.size(bx), b.size(bx));
-                let b_offset = (offset + a_size).align_to(b.default_align(bx).abi);
                 assert!(b_offset.bytes() > 0);
                 let a_val = read_scalar(
                     offset,
```

as *oh my* was that little magic incantation copy-pasted all over the place.

Apologies for the pretty-giant PR.  I tried to make it as direct a change as I could: if it was `(..)` before it's `{ .. }` now, if it was `(_, _)` before it's `{ a: _, b: _, b_offset: _ }` now.  I kept the names the same so the code lines were unchanged even if normally I might have just renamed things, etc.  I'll add some inline notes for places of particular interest.

r? @workingjubilee
…is empty.

This matches the same check from disallowed_macros and skips unnecessary work when the rule has been enabled but not configured.
This PR enables [the community reviews
feature](https://forge.rust-lang.org/triagebot/pr-assignment.html#community-reviews)
in triagebot.

It's configured to require **2 approvals** before automatic assignment
kicks in; manual assignments (`r?`) bypass this requirement.

It's signaled (and controlled) on a PR with the
`S-waiting-on-community-reviews` label ~~(to be created)~~.

Context:
- [#general > Article: Open Code Review at
Bevy](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/Article.3A.20Open.20Code.20Review.20at.20Bevy/with/604251242)
- [#clippy > External approvals and
review](https://rust-lang.zulipchat.com/#narrow/channel/257328-clippy/topic/External.20approvals.20and.20review/with/604254405)
- [Together for a healthier
Clippy](https://blog.rust-lang.org/inside-rust/2026/07/06/unite-for-clippy/)

cc @samueltardieu @blyxyas

changelog: "none"
@rust-log-analyzer

This comment has been minimized.

@flip1995
flip1995 force-pushed the clippy-subtree-update branch from c2aadc5 to a828969 Compare August 7, 2026 11:48
A broken link will make the Clippy subtree sync fail in the compiler
repo.

changelog: none

r? @flip1995
@flip1995
flip1995 marked this pull request as draft August 7, 2026 11:51
@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2026
@flip1995

This comment was marked as outdated.

@flip1995
flip1995 force-pushed the clippy-subtree-update branch from a828969 to 9e7db05 Compare August 7, 2026 11:58
@flip1995
flip1995 marked this pull request as ready for review August 7, 2026 11:58
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 7, 2026
@rustbot

This comment was marked as duplicate.

@samueltardieu

Copy link
Copy Markdown
Member

@bors r+ rollup=never p=1 subtree update

@rust-bors

rust-bors Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9e7db05 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 Aug 7, 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 Aug 7, 2026
@rust-bors

rust-bors Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: samueltardieu
Duration: 3h 11m 53s
Pushing 1a98b1e to main...

@rust-bors
rust-bors Bot merged commit 1a98b1e into rust-lang:main Aug 7, 2026
14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 7, 2026
@flip1995
flip1995 deleted the clippy-subtree-update branch August 7, 2026 22:20
@github-actions

github-actions Bot commented Aug 7, 2026

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 65bcac4 (parent) -> 1a98b1e (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 1a98b1e135b254f209c67d447b6d8bcd56a859e0 --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-netbsd: 56m 32s -> 1h 27m (+54.0%)
  2. x86_64-gnu-llvm-22-3: 1h 9m -> 1h 39m (+43.3%)
  3. x86_64-gnu-gcc: 1h 5m -> 38m 59s (-40.3%)
  4. x86_64-gnu-gcc-core-tests: 11m 33s -> 7m 4s (-38.9%)
  5. i686-msvc-1: 2h 14m -> 3h 3m (+35.9%)
  6. dist-x86_64-llvm-mingw: 1h 58m -> 1h 16m (-35.2%)
  7. x86_64-rust-for-linux: 51m 39s -> 33m 42s (-34.8%)
  8. pr-check-1: 31m 27s -> 21m 32s (-31.5%)
  9. dist-arm-linux-musl: 1h 24m -> 1h 50m (+30.9%)
  10. x86_64-gnu-llvm-21-1: 54m 24s -> 37m 45s (-30.6%)
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 (1a98b1e): 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 0.3%)

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.5% [0.4%, 0.7%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary 0.3%)

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)
1.3% [0.4%, 5.9%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-1.3%, -0.5%] 7
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 458.664s -> 458.124s (-0.12%)
Artifact size: 398.60 MiB -> 398.66 MiB (0.02%)

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.