Skip to content

Rollup of 9 pull requests - #160047

Merged
rust-bors[bot] merged 26 commits into
rust-lang:mainfrom
jhpratt:rollup-TvghO9X
Jul 28, 2026
Merged

Rollup of 9 pull requests#160047
rust-bors[bot] merged 26 commits into
rust-lang:mainfrom
jhpratt:rollup-TvghO9X

Conversation

@jhpratt

@jhpratt jhpratt commented Jul 28, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Jules-Bertholet and others added 26 commits July 6, 2026 22:34
The current documentation doesn't guarantee
that these methods are safe to call for pointers
derived from references to new unsized types
that Rust may add in the future.

Co-authored-by: Crystal Durham <cad97@cad97.com>
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
Removes the `pub use rustc_hir_id as hir_id` re-export in `rustc_hir`. This was rarely used and bloated import suggestions a lot.
…r=fee1-dead,ShoyuVanilla

Lint against iterator functions that panic when `N` is zero

This PR extends the deny-by-default `unconditional_panic` lint, by linting on iterator functions that panics when `N` (chunks/windows size) is zero[^attr].

Those methods are [documented](https://doc.rust-lang.org/std/primitive.slice.html#panics-11) to panic if `N` is zero.

```
error: this operation will panic at runtime
  --> $DIR/const-n-is-zero.rs:11:13
   |
LL |     let _ = s.array_windows::<0>();
   |             ^^^^^^^^^^^^^^^^^^^^^^ const parameter `N` is zero
   |
   = note: `#[deny(unconditional_panic)]` on by default
```

cc @rust-lang/libs-api

[^attr]: this is done by introducing a new internal attribute on the const parameter: `#[rustc_panics_when_zero]`
…t, r=mejrs

Allow `UnsafeCell` content access without `get` in `invalid_reference_casting` lint

rust-lang#159730 relaxed the rules so that it's no longer necessary to use `UnsafeCell::raw_get` or `UnsafeCell::get` to access the content of an unsafe cell.

As a consequence this means that code this like is no longer invalid:
```rust
use std::cell::UnsafeCell;

unsafe fn get_mut_unchecked<T>(ptr: &UnsafeCell<T>) -> &mut T {
    let t = ptr as *const UnsafeCell<T> as *mut T;
    unsafe { &mut *t }
}
```

Fixes rust-lang#159915
cc @RalfJung
…r=JohnTitor

Clarify preconditions of raw size/align methods

The current documentation doesn't guarantee that these methods are safe to call for pointers derived from references to new unsized types that Rust may add in the future.

Take 2 of rust-lang#103372, wording from @CAD97 in rust-lang#103372 (comment).

Tracking issue: rust-lang#69835
Don't optimize across storage markers in SimplifyComparisonIntegral

This PR rejects `SimplifyComparisonIntegral` candidates when either `StorageLive` or `StorageDead` for the compared local occurs between the comparison and the terminator.

Since those candidates are rejected, the pass no longer relocates `StorageDead` into switch successors. This conservatively leaves one comparison in `issue_59352` unoptimized, so its MIR snapshots are updated.

Resolves rust-lang#158231.

r? @hanna-kruppe
…8, r=zedddie,Kivooeo

Move tests batch 18

Hi, a few more tests. Part of rust-lang#133895
r? @Kivooeo
…ne, r=chenyukang

Add codegen test for enum clone

Closes rust-lang#69174
Make BorrowSet methods public again

BorrowSet's methods were made private in rust-lang#159449 except for a couple used by Aquascope. I'd like to make these methods public again for Creusot, which indeed makes more extensive use of BorrowSet. Technically only `locals_state_at_exit` exposes information that is not already available in the current API (and Creusot does make use of it to call `Place::ignore_borrow`). The other fields can be reconstructed via `iter`, but it seems unnecessary to restrict the efficient access provided by the other methods to rustc's own analyses as opposed to third-party consumers.
Refactor rustc_hir re-exports

Probably best reviewed commit by commit.

I've been trying to split up rustc_hir and attributes.. This PR prepares for part of that, by cleaning up import paths and moving around some stuff. (See also rust-lang#159602 rust-lang#159659 and rust-lang#159893 for some previous work)
… r=clarfonthey

Correct tracking issue for `casefold` feature

To rust-lang#157000.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jul 28, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 28, 2026
@rustbot rustbot added 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jul 28, 2026
@jhpratt

jhpratt commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

@bors r+ rollup=never p=100

@rust-bors

rust-bors Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c7c6e61 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 Jul 28, 2026
@rust-bors

This comment has been minimized.

@jhpratt

jhpratt commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

@bors treeclosed-

@rust-bors

rust-bors Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Tree is now open for merging.

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

rust-bors Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: jhpratt
Duration: 3h 32m 3s
Pushing e7b5955 to main...

@rust-bors
rust-bors Bot merged commit e7b5955 into rust-lang:main Jul 28, 2026
14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 28, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#153563 Lint against iterator functions that panic when N is zero 4020bb0337d37f3bdf261fd99c1982dbc9e07648 (link)
#159960 Allow UnsafeCell content access without get in `invalid… 62fc7553f140202ab418b6bd2f2cf85d68c4ffc5 (link)
#158893 Clarify preconditions of raw size/align methods 98efdb59e5ad8815486ead8837f3b987695aeaa3 (link)
#159220 Don't optimize across storage markers in SimplifyComparison… 990bfa82d9b0dafc00622c6c51a353ecb7e8178a (link)
#159309 Move tests batch 18 c6dfa9d1b41baa1672f97820dcba4d5164b2053d (link)
#159450 Add codegen test for enum clone a4bc78c1111061df01afe86b0e7c140bf46f66f3 (link)
#160017 Make BorrowSet methods public again 1101bf228ea3de9cd82d4b5ae7294e4276802000 (link)
#160022 Refactor rustc_hir re-exports 36b393e122cf6ad335f45dd1c01b4d8c7416fb6a (link)
#160041 Correct tracking issue for casefold feature 943af579681a991861d7db464c3921e9494c952f (link)

previous master: bf9944f0b8

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

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling glob-match v0.2.1
   Compiling diff v0.1.13
   Compiling citool v0.1.0 (/home/runner/work/rust/rust/src/ci/citool)
    Finished `release` profile [optimized] target(s) in 32.14s
     Running `target/release/citool post-merge-report bf9944f0b8006b152ef4d5f408ae75a0dde3d044 e7b595554e664e6bd281c8cf881093d6c71bc0e1`
Downloading metrics of job aarch64-gnu
Downloading metrics of job aarch64-gnu-debug
Downloading metrics of job arm-android
Downloading metrics of job armhf-gnu
Downloading metrics of job dist-aarch64-linux
Downloading metrics of job dist-android
Downloading metrics of job dist-arm-linux-gnueabi
Downloading metrics of job dist-arm-linux-musl
Downloading metrics of job dist-armhf-linux
Downloading metrics of job dist-armv7-linux
Downloading metrics of job dist-i586-gnu-i586-i686-musl
Downloading metrics of job dist-i686-linux
Downloading metrics of job dist-loongarch64-linux
Downloading metrics of job dist-loongarch64-musl
Downloading metrics of job dist-ohos-aarch64
Downloading metrics of job dist-ohos-armv7
Downloading metrics of job dist-ohos-x86_64
Downloading metrics of job dist-powerpc-linux
Downloading metrics of job dist-powerpc64-linux-gnu
Downloading metrics of job dist-powerpc64-linux-musl
Downloading metrics of job dist-powerpc64le-linux-gnu
Downloading metrics of job dist-powerpc64le-linux-musl
Did not find metrics for job `dist-powerpc64le-linux-musl` at `bf9944f0b8006b152ef4d5f408ae75a0dde3d044`: io: Connection reset by peer (os error 104).
Maybe it was newly added?
Downloading metrics of job dist-riscv64-linux-gnu
Downloading metrics of job dist-riscv64-linux-musl
Downloading metrics of job dist-s390x-linux
Downloading metrics of job dist-various-1
Downloading metrics of job dist-various-2
Downloading metrics of job dist-x86_64-freebsd
Downloading metrics of job dist-aarch64-freebsd
Downloading metrics of job dist-x86_64-illumos
Downloading metrics of job dist-x86_64-linux
Downloading metrics of job dist-x86_64-linux-alt
Downloading metrics of job dist-x86_64-musl
Downloading metrics of job dist-x86_64-netbsd
Downloading metrics of job dist-x86_64-solaris
Downloading metrics of job dist-sparcv9-solaris
Downloading metrics of job i686-gnu-1
Downloading metrics of job i686-gnu-2
Downloading metrics of job i686-gnu-nopt-1
Downloading metrics of job i686-gnu-nopt-2
Downloading metrics of job pr-check-1
Downloading metrics of job pr-check-2
Downloading metrics of job tidy
Downloading metrics of job test-various
Downloading metrics of job x86_64-rust-for-linux
Downloading metrics of job x86_64-gnu
Downloading metrics of job x86_64-gnu-parallel-frontend
Downloading metrics of job x86_64-gnu-stable

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e7b5955): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.4% [0.4%, 0.4%] 2
Regressions ❌
(secondary)
0.3% [0.1%, 0.6%] 8
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) 0.0% [-0.8%, 0.4%] 3

Max RSS (memory usage)

Results (primary -3.4%, secondary 0.4%)

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

mean range count
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
2.6% [2.4%, 2.8%] 2
Improvements ✅
(primary)
-9.8% [-9.8%, -9.8%] 1
Improvements ✅
(secondary)
-4.1% [-4.1%, -4.1%] 1
All ❌✅ (primary) -3.4% [-9.8%, 3.0%] 2

Cycles

Results (primary -0.1%, 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)
2.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
3.9% [2.9%, 4.7%] 3
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
-4.1% [-5.8%, -2.6%] 5
All ❌✅ (primary) -0.1% [-2.6%, 2.4%] 2

Binary size

Results (primary 0.2%, secondary 0.4%)

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

mean range count
Regressions ❌
(primary)
0.4% [0.0%, 0.6%] 15
Regressions ❌
(secondary)
0.4% [0.0%, 0.7%] 56
Improvements ✅
(primary)
-0.3% [-0.7%, -0.2%] 7
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) 0.2% [-0.7%, 0.6%] 22

Bootstrap: 487.856s -> 490.22s (0.48%)
Artifact size: 388.05 MiB -> 390.35 MiB (0.59%)

@rustbot rustbot added the perf-regression Performance regression. label Jul 28, 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-rustdoc-json Area: Rustdoc JSON backend merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. rollup A PR which is a rollup 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.