Skip to content

fix(interp): Treat UnsafeBinder as Compound Type in try_visit_primitive#153458

Open
TKanX wants to merge 1 commit intorust-lang:mainfrom
TKanX:bugfix/153362-ice-unsafe-binder-validity
Open

fix(interp): Treat UnsafeBinder as Compound Type in try_visit_primitive#153458
TKanX wants to merge 1 commit intorust-lang:mainfrom
TKanX:bugfix/153362-ice-unsafe-binder-validity

Conversation

@TKanX
Copy link
Contributor

@TKanX TKanX commented Mar 5, 2026

Summary:

Fixes ICE in const eval validity checking when a value contains an UnsafeBinder-typed field.

try_visit_primitive in validity.rs had ty::UnsafeBinder(_) => todo!("FIXME(unsafe_binder)"): a placeholder left by the initial unsafe binders type system implementation (9a1c5eb).

The fix is to remove the todo!() and move UnsafeBinder into the compound types arm.

Closes #153362

r? @dingxiangfei2009
cc @matthiaskrgr

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 5, 2026
@TKanX TKanX marked this pull request as ready for review March 5, 2026 19:34
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2026

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 5, 2026
@Kivooeo
Copy link
Member

Kivooeo commented Mar 5, 2026

can you explain a bit your choice of this match arm?

@TKanX
Copy link
Contributor Author

TKanX commented Mar 5, 2026

can you explain a bit your choice of this match arm?

Since layout.rs erases bound regions and delegates entirely to the inner type, I think returning false and letting walk_value recurse via FieldsShape is correct (similar to Pat or Closure).

Happy to be corrected if there's something specific.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: try_visit_primitive() on unsafe binder

4 participants