Skip to content

Add a regression test for an unconstrained TransmuteFrom ICE#157366

Open
johnproblems wants to merge 1 commit into
rust-lang:mainfrom
johnproblems:add-ice-regression-tests
Open

Add a regression test for an unconstrained TransmuteFrom ICE#157366
johnproblems wants to merge 1 commit into
rust-lang:mainfrom
johnproblems:add-ice-regression-tests

Conversation

@johnproblems
Copy link
Copy Markdown

@johnproblems johnproblems commented Jun 3, 2026

#151314: calling a function with an unconstrained TransmuteFrom obligation used to ICE with layout_of: unexpected type under the next-gen trait solver. It now reports type annotations needed (E0283) as expected. Fixed in #154991, but the issue was labelled E-needs-test and lacked a regression test, so this adds the original reproducer so it can't silently regress.

Closes #151314

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

rustbot commented Jun 3, 2026

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

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

@rustbot

This comment has been minimized.

@johnproblems johnproblems force-pushed the add-ice-regression-tests branch from f72a5de to 9eba2a4 Compare June 3, 2026 08:06
Comment thread tests/ui/const-generics/mgca/inherent-assoc-const-array-length.rs Outdated
An unconstrained `TransmuteFrom` obligation used to ICE with `layout_of:
unexpected type` under the next-gen trait solver; it now reports `type
annotations needed` (E0283). Add a regression test for that case, which
the fix's own test suite did not cover.
@johnproblems johnproblems force-pushed the add-ice-regression-tests branch from 9eba2a4 to 8e7be34 Compare June 3, 2026 09:08
@johnproblems
Copy link
Copy Markdown
Author

Thanks for catching that — you're right. I'd only checked that the original const repro now errors cleanly; I hadn't tried the type const form the diagnostic suggests, which still ICEs, so the issue isn't actually resolved. I've removed that test and kept just the next-solver TransmuteFrom one. Appreciate the review!

@reddevilmidzy
Copy link
Copy Markdown
Member

Good, and please also change the PR title and description.

@johnproblems johnproblems changed the title Add regression tests for #151314 and #142773 Add a regression test for an unconstrained TransmuteFrom ICE Jun 4, 2026
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. 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]: layout_of: unexpected type _

4 participants