Skip to content

Rollup of 6 pull requests#155011

Merged
rust-bors[bot] merged 19 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-9GJWM3g
Apr 9, 2026
Merged

Rollup of 6 pull requests#155011
rust-bors[bot] merged 19 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-9GJWM3g

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

folkertdev and others added 19 commits April 6, 2026 14:58
…classes

Add new Hexagon inline asm register classes:
- reg_pair: GPR double registers (r1:0 through r27:26) for i64/f64 types
- vreg: HVX vector registers (v0-v31) for mode-dependent vector types
- vreg_pair: HVX vector pair registers (v1:0 through v31:30) for vector pairs
- qreg: HVX predicate registers (q0-q3), clobber-only

Key implementation details:
- GPR pairs use LLVM's 'd' register naming (d0-d13) for constraints
- HVX vector pairs use LLVM's 'w' register naming (w0-w15) for constraints
- Register overlap tracking for GPR pair<->single and HVX pair<->single conflicts
- HVX vector types are mode-dependent (64B vs 128B HVX length)

Note: vreg_quad (HVX vector quads) is not supported as LLVM's Hexagon
backend does not support vector quad types in inline asm constraints.
The AST pretty printer produces invalid Rust when a block expression is
the base of an index operation inside a macro expansion. This is a gap
in the existing `FixupContext` parenthesization machinery — the approach
handles statement position but not the case where a block-index is
nested inside another expression.

The following is a correct program:

```rust
macro_rules! block_arr {
    () => {{ [0u8; 4] }};
}

macro_rules! as_slice {
    () => {{ &block_arr!()[..] }};
}

fn main() { let _: &[u8] = as_slice!(); }
```

But `rustc -Zunpretty=expanded` produces output that is not valid Rust,
because the closing brace of `{ [0u8; 4] }` creates a statement
boundary, causing the parser to treat `[..]` as a separate expression:

```rust
fn main() { let _: &[u8] = { &{ [0u8; 4] }[..] }; }
```

```
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `[`
```

Fixed output after this change:

```rust
fn main() { let _: &[u8] = { &({ [0u8; 4] })[..] }; }
```

Since `{ ... }[...]` never parses as indexing a block regardless of
context, the fix unconditionally parenthesizes "complete" expressions
(block, match, if, loop, etc.) when they appear as the base of an index
operation.
When a macro expands to a call whose callee is a block (or other
"complete" expression like `match`, `if`, `loop`), the AST pretty
printer emits the callee without parentheses. In statement position
the closing brace ends the expression and the argument list is parsed
as a separate tuple expression, producing a parse error.
I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.
… have special syntax

I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.
…athanBrouwer

Remove `BuiltinLintDiag`

Part of rust-lang#153099.

We're finally getting rid of `BuiltinLintDiag`! \o/

Next step, `AttributeLint`. :3

r? @JonathanBrouwer
…ion, r=mati865

test `#[naked]` with `#[link_section = "..."]` on windows

As a part of rust-lang#147811 I ran into that we actually don't match (current) LLVM output.

r? @mati865
…ter-classes, r=JohnTitor

Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg register classes

Add three new register classes for the Hexagon inline assembly backend:

* `reg_pair`: GPR double registers (r1:0 through r27:26)
* `vreg`: HVX vector registers (v0-v31)
* `qreg`: HVX predicate registers (q0-q3), clobber-only for now
Parenthesize block-like expressions in index base of pretty printer

The AST pretty printer produces invalid Rust when a block expression is the base of an index operation inside a macro expansion. This is a gap in the parenthesization fix from rust-lang#119105 — the `FixupContext` approach handles statement position but not the case where a block-index is nested inside another expression.

The following is a correct program:

```rust
macro_rules! block_arr {
    () => {{ [0u8; 4] }};
}

macro_rules! as_slice {
    () => {{ &block_arr!()[..] }};
}

fn main() { let _: &[u8] = as_slice!(); }
```

But `rustc -Zunpretty=expanded` produces output that is not valid Rust, because the closing brace of `{ [0u8; 4] }` creates a statement boundary, causing the parser to treat `[..]` as a separate expression:

```rust
fn main() { let _: &[u8] = { &{ [0u8; 4] }[..] }; }
```

```
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `[`
```

Fixed output after this change:

```rust
fn main() { let _: &[u8] = { &({ [0u8; 4] })[..] }; }
```

Since `{ ... }[...]` never parses as indexing a block regardless of context, the fix unconditionally parenthesizes "complete" expressions (block, match, if, loop, etc.) when they appear as the base of an index operation.
…tive, r=JonathanBrouwer

make `expected_literal` positive

r? @JonathanBrouwer
…ross35

Clarify that `core::range` ranges do not have special syntax

r? @tgross35
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Apr 8, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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. labels Apr 8, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 8, 2026

📌 Commit efa9224 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 Apr 8, 2026
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Apr 8, 2026
Rollup of 6 pull requests


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

This comment has been minimized.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

☀️ Try build successful (CI)
Build commit: 6820013 (682001337b9d1a681e0b5eaa47a30d571f3ba276, parent: 033b9255d4cc0055d7040b996a165f3a6e4bd832)

@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 Apr 9, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 20m 4s
Pushing d0442e2 to main...

@rust-bors rust-bors bot merged commit d0442e2 into rust-lang:main Apr 9, 2026
13 checks passed
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 9, 2026

☀️ Test successful - CI, Post merge analysis
Approved by: JonathanBrouwer
Duration: 3h 20m 4s
Pushing d0442e2 to main...

@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#154057 Parenthesize block-like expressions in index base of pretty… e7497e308d5eac822b6a599b25cbb5f82ffbffcb (link)
#154598 test #[naked] with #[link_section = "..."] on windows 91cdc0839cdc2666189e1541f9430791bb21ead9 (link)
#154719 Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg… 186c6c0b084d70d223dbbd64d602be02b932032d (link)
#154893 make expected_literal positive be0c00a1957e43b73b93daeaa9127d067843199d (link)
#154912 Remove BuiltinLintDiag f962ca4c9cb4216b8845fffa1c991b0b1d7a62de (link)
#155002 Clarify that core::range ranges do not have special syntax 9e572c4527a834ff6d31213fee154b716b9bbf92 (link)

previous master: 9004856428

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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 9004856 (parent) -> d0442e2 (this PR)

Test differences

Show 87 test diffs

Stage 1

  • [assembly] tests/assembly-llvm/naked-functions/link-section-windows.rs#windows-x86-gnu: [missing] -> pass (J1)
  • [assembly] tests/assembly-llvm/naked-functions/link-section-windows.rs#windows-x86-msvc: [missing] -> pass (J1)
  • [pretty] tests/pretty/block-index-or-call-paren.rs: [missing] -> pass (J1)
  • [ui] tests/ui/asm/hexagon/bad-reg.rs: [missing] -> pass (J1)

Stage 2

  • [pretty] tests/pretty/block-index-or-call-paren.rs: [missing] -> pass (J0)
  • [assembly] tests/assembly-llvm/naked-functions/link-section-windows.rs#windows-x86-gnu: [missing] -> pass (J2)
  • [assembly] tests/assembly-llvm/naked-functions/link-section-windows.rs#windows-x86-msvc: [missing] -> pass (J2)
  • [ui] tests/ui/asm/hexagon/bad-reg.rs: [missing] -> pass (J3)
  • [ui] tests/ui/asm/hexagon/bad-reg.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)

Additionally, 78 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 d0442e2800d356ae282ddcdbe0eff8798fe648b6 --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-arm-linux-gnueabi: 1h 9m -> 1h 27m (+26.1%)
  2. x86_64-gnu-llvm-21: 1h 30m -> 1h 16m (-16.1%)
  3. aarch64-apple: 2h 54m -> 3h 13m (+11.1%)
  4. dist-x86_64-apple: 2h 21m -> 2h 7m (-10.0%)
  5. x86_64-gnu-gcc: 1h 8m -> 1h 2m (-9.1%)
  6. i686-gnu-nopt-1: 2h 10m -> 2h 22m (+9.1%)
  7. tidy: 2m 37s -> 2m 51s (+8.4%)
  8. dist-i586-gnu-i586-i686-musl: 1h 27m -> 1h 34m (+8.4%)
  9. x86_64-mingw-1: 2h 52m -> 2h 39m (-7.4%)
  10. x86_64-gnu-tools: 1h 6m -> 1h 2m (-6.8%)
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 (d0442e2): comparison URL.

Overall result: ❌ regressions - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.3% [0.2%, 0.4%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.7%, secondary 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)
2.1% [1.9%, 2.3%] 2
Improvements ✅
(primary)
-0.7% [-0.7%, -0.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-0.7%, -0.7%] 1

Cycles

Results (secondary -2.8%)

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

Binary size

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

Bootstrap: 489.506s -> 489.468s (-0.01%)
Artifact size: 395.50 MiB -> 395.51 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Apr 9, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@rustbot label: +perf-regression-triaged
See #154912

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants