Skip to content

Rollup of 11 pull requests - #166162

Merged
rust-bors[bot] merged 28 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-rodzZnf
Nov 19, 2026
Merged

rust-bors[bot] merged 28 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-rodzZnf

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

tmiasko and others added 28 commits November 13, 2026 17:23
The previous implementation inserted each new statement in a block
separately, which in the worst case moved all existing statements each
time.

Use a simple merging strategy to improve complexity from
O(num existing statements × num new statements) to
O(num existing statements + num new statements).
For reference patterns like `&(v @ S{a, b})` the compiler emits the
unused parens warning. Without the parenthesis the pattern becomes
`&v @ S{a, b}` which makes the expression look a little confusing and
it seems like `v` is being binded by reference.

Add an explicit pattern matcher to catch such a pattern that would
involve an identifier binding with a compound type and avoid emitting
the `unused_parens` diagnostics for this.

Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
Signed-off-by: Hardik Kumar <hardikxk@gmail.com>
…teAttribute`

Currently, `UnusedDuplicate` is used when a duplicate attribute is a warning,
and `UnusedMultiple` is used when it is an error.
This commit removes the redundancy in favor of a new lint, `DuplicateAttribute`.

The error messages now look like "duplicate `X` attributes", instead of
"multiple `X` attributes" or "duplicate attribute".

Thanks to @JonathanBrouwer for the suggestion to work on this
MirPatch: reduce new statement insertion complexity

The previous implementation inserted each new statement in a block separately, which in the worst case moved all existing statements each time.

Use a simple merging strategy to improve complexity from O(num existing statements × num new statements) to O(num existing statements + num new statements).

Helps with rust-lang#121354.
…tr, r=JonathanBrouwer

test `feature(asm_const_ptr)` with a vtable

This tests an interesting interaction between features, and a special code path for generating vtables. I'm especially interested in how/whether the GCC backend supports this correctly.
…etrochenkov

Chain the spans of qualified paths instead of having a first-to-last scheme

> [!CAUTION]
> **Stacked** on top of rust-lang#165875. Do not merge before it.

This patch changes how qualified paths build spans, from first-to-last to a chained scheme, contributing to rust-lang#126763.

NB: only the last commit contains new changes.

r? @petrochenkov
…-self-type, r=mu001999

Fix dead-code marking dead enum variants as live

This fixes a bug with the dead-code lint. Constructing an enum variant inside a match arm that matches on the same enum variant should not count to it being marked as live. This behavior was already implemented, but it only worked when the pattern matches on the enum type directly, not via the `Self` type alias. As an example, see:
```rust
enum Enum {
	Variant1, // This is marked as dead
	Variant2, // This isnt
}

impl Clone for Enum {
	fn clone(&self) -> Self {
		match self {
			Enum::Variant1 => Enum::Variant1,
			Self::Variant2 => Self::Variant2,
		}
	}
}

fn main() {
	// keep enum itself live
	let _: Enum = todo!();
}
```

This PR fixes this by resolving the `QPath` of the pattern properly.

As a result, the derived `Clone` impl for an enum like the above now doesn't result in the variants being kept alive at all. Previously, we'd get a note saying that a variant is constructed in the `Clone` impl but that this was being intentionally ignored (due to `#[rustc_trivial_field_reads]`), but now this note does not appear anymore.

Additionally, this PR also adds a test which actually uses the `ignore_variant_stack` (i.e. the mechanism responsible for preventing enum variants from being marked live in arms where we match on them).  The original PR (rust-lang#25961) which added the `ignore_variant_stack` also added a test that uses `#[derive(Clone)]` to test the ignored variant stack.
However, after `rustc_trivial_field_reads` was added  (in rust-lang#85200), this test didn't actually run into the dead variant stack anymore, since the derived `Clone` impl was ignored for dead-code analysis. So on current `main` it was possible to remove the `ignore_variant_stack` entirely without a single test failing.

r? @mu001999
…ta-layout, r=mati865

rustc_target: catch up with LLVM 24 movement on ppc64le bsd data layout

Changed in LLVM today: llvm/llvm-project#232336

@rustbot label: +llvm-main
…, r=ChrisDenton

windows seek_write: document interaction with append mode

[MS docs](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntwritefile) say that the offset is ignored for files opened with FILE_APPEND_DATA. Our `append(true)` [maps to](https://github.com/rust-lang/rust/blob/0df97849e3a1abbaff8969ec3b9cd9334ab68790/library/std/src/sys/fs/windows.rs#L294-L295) `c::FILE_GENERIC_WRITE & !c::FILE_WRITE_DATA` for `CreateFileW`... which then presumably translates into `FILE_APPEND_DATA` for `NtCreateFile`?

r? @ChrisDenton
…-diagnostic, r=JonathanBrouwer

Duplicate attribute diagnostic cleanups

Currently there are two different diagnostics for when you can't have a duplicate attribute on an item, `UnusedDuplicate` and `UnusedMultiple`. This PR deduplicates their behavior into `UnusedMultiple`. In a separate commit, it renames `UnusedMultiple` to `DuplicateAttribute`, a more sensible name.

Separately, the third commit fixes a small issue where diagnostics about attributes would be printed with `..` as a path separator instead of `::`

Thanks to Jonathan Brouwer for the suggestion to work on this!

r? @JonathanBrouwer
…kertdev

lint: Avoid unused_parens warning for ref patterns binding an identifier

For reference patterns like `&(v @ S{a, b})` the compiler emits the unused parens warning. Without the parenthesis the pattern becomes `&v @ S{a, b}` which makes the expression look a little confusing and it seems like `v` is being binded by reference.

Add an explicit pattern matcher to catch all such patterns that would involve an identifier binding with any pattern and avoid emitting the `unused_parens` diagnostic for this.

closes rust-lang#165636
…dianne

`rustc_mir_build`: de-duplicate `local_temp_lifetime()`
…ohnTitor

Add `cd` alias to `std::env::set_current_dir`

Addresses rust-lang#130058, let me know if there are any suggestions to add.

Adds the `cd` alias to the [`std::env::set_current_dir`](https://doc.rust-lang.org/stable/std/env/fn.set_current_dir.html) function, which can make finding it easier.
…t, r=panstromek

Don't recover invalid literals in attribute parsing

The attempt at parser recovery creates duplicate diagnostics, where the non-recovered diagnostic is better, so we should remove it.

This is also blocking for rust-lang#164898
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 18, 2026
@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Nov 18, 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Nov 18, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,dist-various-2,test-various,test-x86_64-gnu-aux,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu,test-x86_64-gnu-llvm-22-3,test-aarch64-msvc-2

@rust-bors

rust-bors Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 260090f has been approved by JonathanBrouwer

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 18, 2026
Rollup of 11 pull requests


try-job: dist-various-1
try-job: dist-various-2
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
try-job: test-x86_64-gnu-llvm-22-3
try-job: test-aarch64-msvc-2
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 18, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #165913 (MirPatch: reduce new statement insertion complexity)
 - #166081 (test `feature(asm_const_ptr)` with a vtable)
 - #166094 (Chain the spans of qualified paths instead of having a first-to-last scheme )
 - #166113 (Fix dead-code marking dead enum variants as live)
 - #166118 (rustc_target: catch up with LLVM 24 movement on ppc64le bsd data layout)
 - #166155 (windows seek_write: document interaction with append mode)
 - #165935 (Duplicate attribute diagnostic cleanups)
 - #165948 (lint: Avoid unused_parens warning for ref patterns binding an identifier)
 - #166018 (`rustc_mir_build`: de-duplicate `local_temp_lifetime()`)
 - #166111 (Add `cd` alias to `std::env::set_current_dir`)
 - #166157 (Don't recover invalid literals in attribute parsing)
@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 Nov 18, 2026
@rust-bors

rust-bors Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 3905bab failed: CI. Failed job:

@rust-bors

rust-bors Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 082ebbd (082ebbd04623d07a6b0b77620d8af4a6ea5a00a9)
Base parent: 65ce861 (65ce8611fed3142053320be6996ef00e9992671f)

@JonathanBrouwer

Copy link
Copy Markdown
Member Author

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

rust-bors Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 21m
Pushing b0b6006 to main...

@rust-bors
rust-bors Bot merged commit b0b6006 into rust-lang:main Nov 19, 2026
16 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 19, 2026
@github-actions

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 e3b9a83 (parent) -> b0b6006 (this PR)

Test differences

Show 130 test diffs

Stage 1

  • [ui] tests/ui/asm/x86_64/const-operand-vtable.rs: [missing] -> pass (J0)
  • [ui] tests/ui/lint/dead-code/unused-variant-manual-clone-impl-tuple.rs: [missing] -> pass (J0)
  • [ui] tests/ui/lint/dead-code/unused-variant-manual-clone-impl.rs: [missing] -> pass (J0)
  • [ui] tests/ui/lint/unused_parens_reference_binding.rs: [missing] -> pass (J0)
  • [ui (polonius)] tests/ui/asm/x86_64/const-operand-vtable.rs: [missing] -> pass (J3)
  • [ui (polonius)] tests/ui/lint/dead-code/unused-variant-manual-clone-impl-tuple.rs: [missing] -> pass (J3)
  • [ui (polonius)] tests/ui/lint/dead-code/unused-variant-manual-clone-impl.rs: [missing] -> pass (J3)
  • [ui (polonius)] tests/ui/lint/unused_parens_reference_binding.rs: [missing] -> pass (J3)

Stage 2

  • [ui] tests/ui/lint/dead-code/unused-variant-manual-clone-impl-tuple.rs: [missing] -> pass (J1)
  • [ui] tests/ui/lint/dead-code/unused-variant-manual-clone-impl.rs: [missing] -> pass (J1)
  • [ui] tests/ui/lint/unused_parens_reference_binding.rs: [missing] -> pass (J1)
  • [ui] tests/ui/asm/x86_64/const-operand-vtable.rs: [missing] -> ignore (only executed when the operating system is linux) (J2)
  • [ui] tests/ui/asm/x86_64/const-operand-vtable.rs: [missing] -> ignore (only executed when the architecture is x86_64) (J4)
  • [ui] tests/ui/asm/x86_64/const-operand-vtable.rs: [missing] -> pass (J5)

Additionally, 116 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 b0b600668bb9b4a897e2299b0a44289d42276545 --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: 9m 43s -> 17m 30s (+80.1%)
  2. test-i686-msvc: 1h 58m -> 3h 19m (+68.7%)
  3. test-x86_64-gnu-parallel-frontend: 1h 17m -> 2h 9m (+66.8%)
  4. test-x86_64-gnu-next-trait-solver-polonius: 42m 41s -> 1h 8m (+60.1%)
  5. dist-aarch64-apple: 1h 41m -> 2h 40m (+58.0%)
  6. test-various: 1h 25m -> 2h 14m (+57.8%)
  7. test-aarch64-apple-macos-26-2: 1h 25m -> 2h 12m (+55.3%)
  8. test-aarch64-apple-2: 1h 34m -> 2h 23m (+52.7%)
  9. dist-s390x-linux: 1h 4m -> 1h 37m (+50.7%)
  10. test-x86_64-gnu-stdlib-semver-check: 8m 21s -> 12m 34s (+50.5%)
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 (b0b6006): 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.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.7% [0.7%, 0.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 1

Max RSS (memory usage)

Results (primary 0.9%, secondary -0.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.9% [0.9%, 0.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.8%, -0.4%] 4
All ❌✅ (primary) 0.9% [0.9%, 0.9%] 1

Cycles

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

Binary size

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

Bootstrap: 459.437s -> 459.328s (-0.02%)
Artifact size: 405.35 MiB -> 405.33 MiB (-0.01%)

@rust-bors

rust-bors Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#165913 MirPatch: reduce new statement insertion complexity b51168e67fe68dd108c2394ee5c3229c76beb5fd
(link)
#166081 test feature(asm_const_ptr) with a vtable bf535f346fa6ad196bfb56118e0ec3136b24fe71
(link)
#166094 Chain the spans of qualified paths instead of having a firs… eb2d8a267365c557f97a6220e23dcfb1e5315d68
(link)
#166113 Fix dead-code marking dead enum variants as live f3ea802f21f8a33de05924bf70816ebbc1aa1d07
(link)
#166118 rustc_target: catch up with LLVM 24 movement on ppc64le bsd… 24c5a2cc945ef64f917877af1f0e285725f997b2
(link)
#166155 windows seek_write: document interaction with append mode 7b04686f0889b13975f35eb9c13c950a3075a8de
(link)
#165935 Duplicate attribute diagnostic cleanups 63a2c7d626266f748607150f453bc6e7c47719d3
(link)
#165948 lint: Avoid unused_parens warning for ref patterns binding … e28b0c69bebae624da7b60f0107cb8df7c55c7cc
(link)
#166018 rustc_mir_build: de-duplicate local_temp_lifetime() 392b991cd0e6e4e74078f6f8e2317e07fd89c299
(link)
#166111 Add cd alias to std::env::set_current_dir 09fc8a6b4cabc49d2bb2b39e4bdb16267c7c6696
(link)
#166157 Don't recover invalid literals in attribute parsing a63b6b91bff5fa0efc21c8cfd629128fc19e39eb
(link)

parent commit: e3b9a8345a

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-env Area: `std::env` (note: `std::process` is A-process) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. O-windows Operating system: Windows rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.