Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

@JonathanBrouwer JonathanBrouwer commented Dec 28, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

max-heller and others added 18 commits December 2, 2025 20:54
- Add path field to uefi file since this will also be required in
  implementing Debug for rust File.
- Tested on OVMF.

Signed-off-by: Ayush Singh <[email protected]>
This fixes the ICE reported by rejecting `const` blocks in
pattern position during AST lowering.

Previously, `ExprKind::ConstBlock` could reach HIR as `PatExprKind::ConstBlock`,
allowing invalid patterns to be type-checked and triggering an ICE.
This patch removes the lowering path for const blocks in patterns
and emits a proper diagnostic instead.

A new UI test is added to ensure the compiler reports a regular error
and to prevent regressions.
Replace unicode-xid with unicode-ident which is 6 times faster
Add a compile time check in rustc_lexer and rustc_parse ensuring that unicode-related dependencies within the crate use the same unicode version.
These checks are inspired by the examples privided by @clarfonthey.
parser/lexer: bump to Unicode 17, use faster unicode-ident

Hello,

Bump the unicode version used by lexer/parser to 17.0.0 by updating:
- `unicode-normalization` to 0.1.25
- `unicode-properties` to 0.1.4
- `unicode-width` to 0.2.2

and by replacing `unicode-xid` with `unicode-ident` which is also 6 times faster.
I think it might be worth to run the benchmarks to double check.
(`unicode-ident` is already in `src/tools/tidy/src/deps.rs`)

Thanks!
…Simulacrum

std: sys: fs: uefi: Implement readdir

- Tested on OVMF.
- Add path field to uefi file since this will also be required in
  implementing Debug for rust File.

``@rustbot`` label +O-UEFI
…on, r=Mark-Simulacrum

Implement `Duration::div_duration_{floor,ceil}`
… r=Mark-Simulacrum

Optimized implementation for uN::{gather,scatter}_bits

Feature gate: #![feature(uint_gather_scatter_bits)]
Tracking issue: rust-lang#149069
Accepted ACP: rust-lang/libs-team#695

Implements the methods using the parallel suffix strategy mentioned in the ACP discussion. The referenced source material provides C implementations, though this PR makes improvements over those, cutting the instruction count by a third:
https://rust.godbolt.org/z/rn5naYnK4 (this PR)
https://c.godbolt.org/z/WzYd5WbsY (Hacker's delight)

This was initially based on the code for `gather_bits` that ``@okaneco`` provided in rust-lang/libs-team#695 (comment) . I wanted to understand how it worked, and later on noticed some opportunities for improvement, which eventually led to this PR.
…8, r=dianne

Fix ICE by rejecting const blocks in patterns during AST lowering (closes rust-lang#148138)

This PR fixes the ICE reported in rust-lang#148138.

The root cause is that `const` blocks aren’t allowed in pattern position, but the AST lowering logic still attempted to create `PatExprKind::ConstBlock`, allowing invalid HIR to reach type checking and trigger a `span_bug!`.

Following the discussion in the issue, this patch removes the `ConstBlock` lowering path from `lower_expr_within_pat`. Any `ExprKind::ConstBlock` inside a pattern is now handled consistently with other invalid pattern expressions.

A new UI test is included to ensure the compiler reports a proper error and to prevent regressions.

Closes rust-lang#148138.
add several older crashtests

Includes rust-lang#114880, rust-lang#119940, rust-lang#138274, rust-lang#138660.
Since their issue numbers are all smaller than 140000, this has no conflicts with rust-lang#147857.
…, r=Mark-Simulacrum

Add more `unbounded_sh[lr]` examples

Inspired by rust-lang#149837, which added more stuff to `wrapping_sh[lr]`, including a cross-reference to these methods.
refactor `destructure_const`

r? BoxyUwU

as you suggested yesterday (will add more context like links when it stops being a draft)

tried to split this into some meaningful commits hope it help ^^
@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. 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. rollup A PR which is a rollup labels Dec 28, 2025
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Dec 28, 2025

📌 Commit 1117bd9 has been approved by JonathanBrouwer

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 Dec 28, 2025
@bors
Copy link
Collaborator

bors commented Dec 28, 2025

⌛ Testing commit 1117bd9 with merge 7fefa09...

@bors
Copy link
Collaborator

bors commented Dec 29, 2025

☀️ Test successful - checks-actions
Approved by: JonathanBrouwer
Pushing 7fefa09 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 29, 2025
@bors bors merged commit 7fefa09 into rust-lang:main Dec 29, 2025
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 29, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#148321 parser/lexer: bump to Unicode 17, use faster unicode-ident 0b2c87f4d03ced11f8b7e5dbaf790a75f17ed98c (link)
#149540 std: sys: fs: uefi: Implement readdir 1327bdf441fcc16add5668206484ed6e78e3be24 (link)
#149582 Implement Duration::div_duration_{floor,ceil} 7d82ce04c027243f39d8f9a4ccb6781b3399ff18 (link)
#149663 Optimized implementation for uN::{gather,scatter}_bits a45c1c96f9d1c59f161483be788dd785bd2600d7 (link)
#149667 Fix ICE by rejecting const blocks in patterns during AST lo… 58ed2d97585a30d75b4958b8e841564ee241005f (link)
#149947 add several older crashtests a8ca2578618d1446744b6402e199aca8490caefc (link)
#150011 Add more unbounded_sh[lr] examples 3b0431bf6d010ab75404246496e7ff728663449e (link)
#150411 refactor destructure_const 1388ff9928e2120d0617eb2cd9416490e96ab30f (link)

previous master: 21cf7fb3ff

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
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 21cf7fb (parent) -> 7fefa09 (this PR)

Test differences

Show 5845 test diffs

Stage 1

  • [crashes] tests/crashes/114880.rs: [missing] -> pass (J1)
  • [crashes] tests/crashes/119940.rs: [missing] -> pass (J1)
  • [crashes] tests/crashes/131052.rs: pass -> [missing] (J1)
  • [crashes] tests/crashes/138274.rs: [missing] -> pass (J1)
  • [crashes] tests/crashes/138660.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/adt_const_params/mismatch-raw-ptr-in-adt.rs: [missing] -> pass (J1)
  • [ui] tests/ui/pattern/deref-patterns/ice-adjust-mode-unimplemented-for-constblock.rs: [missing] -> pass (J1)

Stage 2

  • [crashes] tests/crashes/119940.rs: [missing] -> pass (J0)
  • [crashes] tests/crashes/131052.rs: pass -> [missing] (J0)
  • [crashes] tests/crashes/138274.rs: [missing] -> pass (J0)
  • [crashes] tests/crashes/138660.rs: [missing] -> pass (J0)
  • [ui] tests/ui/const-generics/adt_const_params/mismatch-raw-ptr-in-adt.rs: [missing] -> pass (J2)
  • [ui] tests/ui/pattern/deref-patterns/ice-adjust-mode-unimplemented-for-constblock.rs: [missing] -> pass (J2)
  • [crashes] tests/crashes/114880.rs: [missing] -> pass (J3)
  • [crashes] tests/crashes/114880.rs: [missing] -> ignore (gcc backend is marked as ignore) (J4)

Additionally, 5830 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 7fefa09b90ca57b8a0e0e4717d672d38a0ae58b5 --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. armhf-gnu: 4653.2s -> 5576.8s (+19.8%)
  2. pr-check-1: 1684.4s -> 2014.8s (+19.6%)
  3. dist-aarch64-apple: 7893.5s -> 6361.2s (-19.4%)
  4. x86_64-gnu-llvm-21-2: 5002.4s -> 5962.3s (+19.2%)
  5. dist-x86_64-apple: 6916.5s -> 8173.8s (+18.2%)
  6. x86_64-gnu-distcheck: 7252.8s -> 8566.7s (+18.1%)
  7. dist-s390x-linux: 6071.8s -> 5054.7s (-16.8%)
  8. i686-gnu-2: 5265.4s -> 6125.5s (+16.3%)
  9. x86_64-rust-for-linux: 2763.4s -> 3210.9s (+16.2%)
  10. i686-gnu-1: 7412.7s -> 8561.7s (+15.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
Collaborator

Finished benchmarking commit (7fefa09): comparison URL.

Overall result: ❌ regressions - please read the text below

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.1% [0.1%, 0.2%] 3
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 12
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.2%] 3

Max RSS (memory usage)

Results (primary 2.2%, secondary 1.8%)

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

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
1.8% [1.0%, 3.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.2% [2.2%, 2.2%] 1

Cycles

Results (primary -2.7%, secondary 2.9%)

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)
-2.7% [-4.4%, -2.2%] 7
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.7% [-4.4%, -2.2%] 7

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 485.211s -> 490.488s (1.09%)
Artifact size: 390.87 MiB -> 390.86 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Dec 29, 2025
@bors bors mentioned this pull request Dec 29, 2025
@JonathanBrouwer
Copy link
Contributor Author

JonathanBrouwer commented Dec 29, 2025

@rust-timer build 0b2c87f

@rust-timer

This comment has been minimized.

@Kobzol
Copy link
Member

Kobzol commented Dec 29, 2025

(Only one benchmark can run in parallel on the same PR. I usually start the runs on the individual PRs themselves, rather than on the rollup).

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0b2c87f): comparison URL.

Overall result: ❌ regressions - please read the text below

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.1% [0.1%, 0.2%] 3
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.2%] 3

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (primary -2.6%, secondary 1.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)
5.4% [5.4%, 5.4%] 1
Improvements ✅
(primary)
-2.6% [-3.0%, -2.3%] 6
Improvements ✅
(secondary)
-3.3% [-3.3%, -3.3%] 1
All ❌✅ (primary) -2.6% [-3.0%, -2.3%] 6

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 485.211s -> 484.762s (-0.09%)
Artifact size: 390.87 MiB -> 390.84 MiB (-0.01%)

@JonathanBrouwer
Copy link
Contributor Author

@Kobzol thanks for the advice, will do that in the future

Perf regression is caused by #148321, marked that PR as perf regression instead

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

Labels

A-tidy Area: The tidy tool 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 S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. 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.

ICE adjust mode unimplemented for ConstBlock