Skip to content

Fix an ICE on transmute goals with placeholders in param_env#151373

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ShoyuVanilla:issue-151300
Jan 21, 2026
Merged

Fix an ICE on transmute goals with placeholders in param_env#151373
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ShoyuVanilla:issue-151300

Conversation

@ShoyuVanilla
Copy link
Member

@ShoyuVanilla ShoyuVanilla commented Jan 19, 2026

Fixes #151300

The next solver short-circuits consider_builtin_transmute_candidate when the goal contains non-region placeholders, since rustc_transmute does not support type parameters.
However, this check should likely be refined to apply only to the predicate itself: excess bounds with type params in the param env can cause the goal to be rejected even when its predicate trivially holds.

r? types

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jan 19, 2026
@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 19, 2026

can u take the issue number out of the test name? I don't think it helps much especially when it's already in the test as a comment.

@ShoyuVanilla
Copy link
Member Author

can u take the issue number out of the test name? I don't think it helps much especially when it's already in the test as a comment.

Okay, I'll remove it 😅


// A regression test for https://github.com/rust-lang/rust/issues/151300

#![feature(transmutability)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this to the transmutability folder instead of the general next-solver one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll move it once I get home

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShoyuVanilla
Copy link
Member Author

@bors r=lcnr rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 20, 2026

📌 Commit 328893e has been approved by lcnr

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 Jan 20, 2026
rust-bors bot pushed a commit that referenced this pull request Jan 20, 2026
Rollup of 7 pull requests

Successful merges:

 - #151216 ([rustdoc] Make popover menus content scrollable on mobile devices)
 - #151373 (Fix an ICE on transmute goals with placeholders in `param_env`)
 - #151399 (Generate error delegation when delegation is not resolved)
 - #151406 (Use version 1.93.0 in `RELEASES.md` instead of 1.93)
 - #151410 (Fixes for LLVM 22 compatibility)
 - #151415 (chore: Remove redundant conversion)
 - #151418 (Avoid pulling in unicode when calling io::Error::kind)

r? @ghost
@rust-bors rust-bors bot merged commit c050835 into rust-lang:main Jan 21, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 21, 2026
rust-timer added a commit that referenced this pull request Jan 21, 2026
Rollup merge of #151373 - issue-151300, r=lcnr

Fix an ICE on transmute goals with placeholders in `param_env`

Fixes #151300

The next solver short-circuits `consider_builtin_transmute_candidate` when the goal contains non-region placeholders, since `rustc_transmute` does not support type parameters.
However, this check should likely be refined to apply only to the predicate itself: excess bounds with type params in the param env can cause the goal to be rejected even when its predicate trivially holds.

r? types
@ShoyuVanilla ShoyuVanilla deleted the issue-151300 branch January 21, 2026 01:34
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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: Inconsistent rustc_transmute::is_transmutable(...) result, got Yes

4 participants