Skip to content

Rollup of 9 pull requests - #165313

Merged
rust-bors[bot] merged 25 commits into
rust-lang:mainfrom
jhpratt:rollup-SQF7eQJ
Nov 2, 2026
Merged

rust-bors[bot] merged 25 commits into
rust-lang:mainfrom
jhpratt:rollup-SQF7eQJ

Conversation

@jhpratt

@jhpratt jhpratt commented Nov 2, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

estebank and others added 25 commits September 20, 2026 03:13
```
error[E0425]: cannot find function `bar` in this scope
  --> $DIR/suggest-self-2.rs:9:9
   |
LL |         bar(&&self, 102);
   |         ^^^
   |
help: try calling `bar` as a method
   |
LL -         bar(&&self, 102);
LL +         self.bar(102);
   |
```
The old message, “help: use `let _ = ...` to ignore the resulting
value” (or its variation with `let _unused` for `needs_drop` values),
contains no indication that this is something that you might not want
to do, and in fact can be read as saying that one *should* do this.

The new message, “if you wish to disregard this recommendation, use
`let _ = ...` to ignore the value”, is intended to make it clear that
this is a choice.
* Add regression test
* Recover inner attributes in algebraic data types
* Try to recover after every field and variant
We should not forbid users from experimenting on their own forks.

https://x.com/0xalpharush/status/2116964999000478125
… r=fmease

Recover inner attributes in algebraic data types

Previously, if you'd put an inner attribute in an empty ADT, such as a struct:
```rust
struct Test1 {
    #![inline]
}
```
You'd get the following errors
```
error: an inner attribute is not permitted in this context
 --> src/lib.rs:5:5
  |
5 |     #![cfg(false)]
  |     ^^^^^^^^^^^^^^
  |
  = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
  = note: outer attributes, like `#[test]`, annotate the item following them

error: expected identifier, found `}`
 --> src/lib.rs:6:1
  |
4 | struct Test3 {
  |        ----- while parsing this struct
5 |     #![cfg(false)]
6 | }
  | ^ expected identifier

error: could not compile `rust-test` (lib) due to 2 previous errors
```

The second error is spurious. It was caused by us only recovering inner attributes just before parsing a field, meaning if we see an inner attribute and recover we expect a field next. This PR fixes that by recovering inner attributes just after the curly brace as well.
Make the suggestion message of `unused_must_use` scarier.

The old message, “help: use `let _ = ...` to ignore the resulting value”, contains no indication that this is something that you might not want to do, and in fact can be read as saying that one *should* do this.

The new message, “help: if you wish to disregard this recommendation and immediately drop the value, use `let _ = ...`”, is intended to make it clear that this is a choice, and choosing it has the particular effect of immediately dropping the value.

A possible further improvement, not part of this change, might be to distinguish between types that are `must_use` and have a destructor (whose side-effects are likely relevant), and types that are `must_use` and do not have a destructor, where the timing is irrelevant and the consequence is just ignoring information that was provided. However, not every destructor is relevant to `must_use`; for example, `Result<(), Box<dyn Error>>` has a destructor and is `must_use`, but the destructor is only managing memory for the error value and it has no side effects relevant to the caller (unless the error in the box has side effects of its own).

Inspired by [#t-lang > Lint for assigning drop guards to _](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Lint.20for.20assigning.20drop.20guards.20to.20_/with/624036822)

@rustbot label +A-lints +L-unused_must_use
…mease

Use verbose suggestion for type literal with wrong syntax

```
error[E0423]: cannot find value `StructWithFields` in crate `xcrate_unit_struct`
  --> $DIR/unit-struct.rs:9:33
   |
LL |     let _ = xcrate_unit_struct::StructWithFields;
   |                                 ^^^^^^^^^^^^^^^^
   |
  ::: $DIR/auxiliary/xcrate_unit_struct.rs:20:1
   |
LL | pub struct StructWithFields {
   | --------------------------- `xcrate_unit_struct::StructWithFields` defined here
   |
   = note: a struct named `xcrate_unit_struct::StructWithFields` exists in another namespace
help: use struct literal syntax instead
   |
LL |     let _ = xcrate_unit_struct::StructWithFields { foo: val };
   |                                                  ++++++++++++
```
```
error[E0532]: expected tuple struct or tuple variant, found unit variant `Color::NoColor`
  --> $DIR/match-pattern-field-mismatch-2.rs:12:11
   |
LL | enum Color {
LL |         NoColor,
   |         ------- `Color::NoColor` defined here
...
LL |           Color::NoColor(_) => { }
   |           ^^^^^^^^^^^^^^^^^
   |
help: use the unit struct syntax instead
   |
LL -           Color::NoColor(_) => { }
LL +           Color::NoColor => { }
   |
```
…tern-comma-suggestion, r=fmease

Fix multiple pattern comma suggestions in diagnostics

`skip_pat_list` and `recover_unexpected_comma` is on cold path,
so there will be no perf issue here.
…d-qualifications-wildcard, r=fmease

Don't lint unused_qualifications when the unqualified path is ambiguous

Fixes rust-lang#163310
Improve span for unused_mut lint

Closes rust-lang#165269

I basically used trim to avoid the overlap of spans mentioned on the issue. I kept the whitespace in the "mut" span since the fix removes the whole span and not removing the whitespace would mean for uglier code after fix.

If this is really important, I could add an extra span to the diagnostic struct, but I'll wait on feedback.
…gjubilee

Forward `AbiAlign` `Debug` impl to `Align`

The `Debug` output of `AbiAlign` shows up in UI test stderr output via `LayoutData`. The first commit of this PR changes `Debug` impl of `AbiAlign` to directly forward to `Align`, meaning that the future change from `AbiAlign` to `Align` won't affect test output. The second commit removes unused `//@ normalize-stderr` directives for preferred alignment. Commits are easiest to review individually - most of the changes are just blessing tests.

r? @workingjubilee
…ecks-desc, r=chenyukang

unstable.rs: add missing `]` in description of `cfg_ub_checks`
…=jieyouxu

Clarify AGENTS.md around pushing to a fork

We should not forbid users from experimenting on their own forks.

https://x.com/0xalpharush/status/2116964999000478125

r? @jyn514
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 2, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 2, 2026
@jhpratt

jhpratt commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ab3fd54 has been approved by jhpratt

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 Nov 2, 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 Nov 2, 2026
@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: jhpratt
Duration: 3h 26m 48s
Pushing 2a01bd6 to main...

@rust-bors
rust-bors Bot merged commit 2a01bd6 into rust-lang:main Nov 2, 2026
15 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 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 48dfc3a (parent) -> 2a01bd6 (this PR)

Test differences

Show 29 test diffs

Stage 1

  • [ui (polonius)] tests/ui/lint/unused-qualifications/wildcard-imports-issue-163310.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/parser/empty-adt-inner-attributes.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/suggestions/multiple-pattern-commas.rs: [missing] -> pass (J1)
  • [ui] tests/ui/lint/unused-qualifications/wildcard-imports-issue-163310.rs: [missing] -> pass (J2)
  • [ui] tests/ui/parser/empty-adt-inner-attributes.rs: [missing] -> pass (J2)
  • [ui] tests/ui/suggestions/multiple-pattern-commas.rs: [missing] -> pass (J2)

Stage 2

  • [ui] tests/ui/lint/unused-qualifications/wildcard-imports-issue-163310.rs: [missing] -> pass (J0)
  • [ui] tests/ui/parser/empty-adt-inner-attributes.rs: [missing] -> pass (J0)
  • [ui] tests/ui/suggestions/multiple-pattern-commas.rs: [missing] -> pass (J0)

Additionally, 20 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 2a01bd6f8ba2b81badc578a7fa927d4ff00f8c71 --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. test-x86_64-gnu-gcc-core-tests: 8m 41s -> 18m 4s (+108.1%)
  2. test-x86_64-gnu-stable: 1h 34m -> 2h 55m (+85.5%)
  3. test-x86_64-gnu-tools: 43m 10s -> 1h 12m (+68.1%)
  4. test-x86_64-gnu-aux: 1h 42m -> 2h 46m (+63.4%)
  5. test-i686-gnu-1: 1h 31m -> 2h 29m (+63.4%)
  6. test-x86_64-msvc-ext3: 1h 9m -> 1h 54m (+63.1%)
  7. test-x86_64-gnu-llvm-22-2: 1h 8m -> 1h 49m (+60.1%)
  8. test-x86_64-gnu-stdlib-semver-check: 8m 10s -> 12m 55s (+58.2%)
  9. dist-riscv64-linux-musl: 1h 2m -> 1h 28m (+42.8%)
  10. test-x86_64-gnu-distcheck: 1h 36m -> 2h 17m (+42.0%)
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 (2a01bd6): 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 (primary -2.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)
-2.1% [-2.1%, -2.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.1% [-2.1%, -2.1%] 1

Cycles

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

Binary size

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

Bootstrap: 485.919s -> 487.539s (0.33%)
Artifact size: 406.58 MiB -> 406.62 MiB (0.01%)

@rust-bors

rust-bors Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#162018 Recover inner attributes in algebraic data types 0d050a62a66e11dc7b37703134fc2cc8bb5fe3f1
(link)
#162819 Make the suggestion message of unused_must_use scarier. 84e80612a464a368c7ea5be3e726c1262d94dc8c
(link)
#163053 Use verbose suggestion for type literal with wrong syntax 0a4f9d651de04d886e074b0f9de0f27ad482c7a5
(link)
#163245 Fix multiple pattern comma suggestions in diagnostics 42a8fff7554e3c271c95da8a4835b4a995af226a
(link)
#163369 Don't lint unused_qualifications when the unqualified path … e4972888cf1f472c45bed4288835464d2cb90ed8
(link)
#165282 Improve span for unused_mut lint b01a303f495a7f17953c9b625eb1f6f3660f337e
(link)
#165285 Forward AbiAlign Debug impl to Align 5bf91f5b72001fa5e4207c5a2065d0ba00d9b7b4
(link)
#165294 unstable.rs: add missing ] in description of `cfg_ub_chec… a3350138cc6136f34816727bb29a0c01fffabfd8
(link)
#165310 Clarify AGENTS.md around pushing to a fork f4a07ebbf1001a2604cbbd8c550ffe22175af9bb
(link)

parent commit: 48dfc3a4e0

In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: @rust-timer triage $SHA $SHA $SHA..., or run @rust-timer triage all to benchmark all rollup members.

@jhpratt
jhpratt deleted the rollup-SQF7eQJ branch November 2, 2026 07:35
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. rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.