Skip to content

Fix ICE: Scalar layout for non-primitive non-enum type unsafe binder#154896

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
cijiugechu:fix-unsafe-binder-layout-ice
Apr 28, 2026
Merged

Fix ICE: Scalar layout for non-primitive non-enum type unsafe binder#154896
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
cijiugechu:fix-unsafe-binder-layout-ice

Conversation

@cijiugechu
Copy link
Copy Markdown
Member

@cijiugechu cijiugechu commented Apr 6, 2026

UnsafeBinder uses the inner layout, but the debug layout check still looked at the outer type. Check the inner type first so this does not ICE.

Tracking issue: #130516
Closes: #154426

@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 Apr 6, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 6, 2026

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 10 candidates

Comment thread tests/ui/unsafe-binders/layout-invariant.rs
@cijiugechu cijiugechu force-pushed the fix-unsafe-binder-layout-ice branch from 7f93670 to dface0a Compare April 21, 2026 13:31
@TaKO8Ki
Copy link
Copy Markdown
Member

TaKO8Ki commented Apr 27, 2026

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 27, 2026

📌 Commit dface0a has been approved by TaKO8Ki

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 27, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 27, 2026
…t-ice, r=TaKO8Ki

Fix ICE: Scalar layout for non-primitive non-enum type unsafe binder

`UnsafeBinder` uses the inner layout, but the debug layout check still looked at the outer type. Check the inner type first so this does not ICE.

Tracking issue: rust-lang#130516
Closes: rust-lang#154426
rust-bors Bot pushed a commit that referenced this pull request Apr 27, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #155760 (Remove `AttributeLintKind`)
 - #154510 (Partially stabilize LoongArch target features)
 - #155137 (Allow trailing `self` in more contexts)
 - #155433 (Rip out rustc_layout_scalar_valid_range_* attribute support)
 - #155702 (Change `ItemKind::Trait` to a field variant.)
 - #154896 (Fix ICE: Scalar layout for non-primitive non-enum type unsafe binder)
 - #155675 (Disallow non_exhaustive structs and enums with non_exhaustive variants from implementing `ConstParamTy`)
 - #155874 (Avoid misleading closure return type note)
 - #155876 (CI: rfl: move job forward to Linux v7.1-rc1)
rust-bors Bot pushed a commit that referenced this pull request Apr 27, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #154510 (Partially stabilize LoongArch target features)
 - #155137 (Allow trailing `self` in more contexts)
 - #155513 (rustc_public: implement `Pattern` type)
 - #155702 (Change `ItemKind::Trait` to a field variant.)
 - #154896 (Fix ICE: Scalar layout for non-primitive non-enum type unsafe binder)
 - #155675 (Disallow non_exhaustive structs and enums with non_exhaustive variants from implementing `ConstParamTy`)
 - #155874 (Avoid misleading closure return type note)
 - #155876 (CI: rfl: move job forward to Linux v7.1-rc1)
@rust-bors rust-bors Bot merged commit e683a17 into rust-lang:main Apr 28, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 28, 2026
rust-timer added a commit that referenced this pull request Apr 28, 2026
Rollup merge of #154896 - cijiugechu:fix-unsafe-binder-layout-ice, r=TaKO8Ki

Fix ICE: Scalar layout for non-primitive non-enum type unsafe binder

`UnsafeBinder` uses the inner layout, but the debug layout check still looked at the outer type. Check the inner type first so this does not ICE.

Tracking issue: #130516
Closes: #154426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

[ICE]: Scalar layout for non-primitive non-enum type unsafe

3 participants