Skip to content

Add a regression test for an unconstrained TransmuteFrom ICE#157366

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
johnproblems:add-ice-regression-tests
Jun 12, 2026
Merged

Add a regression test for an unconstrained TransmuteFrom ICE#157366
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
johnproblems:add-ice-regression-tests

Conversation

@johnproblems

@johnproblems johnproblems commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

#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

rustbot commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

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
Contributor 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
@nikomatsakis

Copy link
Copy Markdown
Contributor

bors r+

@johnproblems

Copy link
Copy Markdown
Contributor Author

Thanks for the review @nikomatsakis! Just flagging that the PR still seems to be showing S-waiting-on-review with no confirmation from bors — wasn't sure if it queued okay. Thanks again!

@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+

I forgot we need the @...

@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 8e7be34 has been approved by nikomatsakis

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 Jun 11, 2026
@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors rollup

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 11, 2026
…sts, r=nikomatsakis

Add a regression test for an unconstrained TransmuteFrom ICE

rust-lang#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 rust-lang#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 rust-lang#151314
rust-bors Bot pushed a commit that referenced this pull request Jun 11, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - #157716 (update Enzyme, June'26)
 - #149793 (Add inline asm support for amdgpu)
 - #152852 (Remove driver_lint_caps)
 - #155299 (make repr_transparent_non_zst_fields a hard error)
 - #155439 (Enable Cargo's new build-dir layout)
 - #157612 (Add a test where subtyping inhibits coercion.)
 - #157626 (Autogenerate unstable compiler flag stubs for unstable-book)
 - #157667 (Rename typing modes to better describe real usage)
 - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`)
 - #157342 (Reduce verbosity of cycle errors when possible)
 - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE)
 - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path)
 - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy)
 - #157698 (Remove an unnecessary cloning)
 - #157699 (Arg splat experiment - hir FnDecl impl)
 - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`)
 - #157722 (Move create_scope_map to rustc_codegen_ssa.)
 - #157725 (Keep generic suggestion for macro-expanded missing-type items)
 - #157733 (Remove old FIXMEs about nocapture attribute)
 - #157737 (Reorganize `tests/ui/issues` [7/N])
 - #157746 (supports_c_variadic_definitions: extend checklist for new targets)
 - #157763 (Move unused target expression error to appropriate place and rename it)
 - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
rust-bors Bot pushed a commit that referenced this pull request Jun 11, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - #157716 (update Enzyme, June'26)
 - #149793 (Add inline asm support for amdgpu)
 - #152852 (Remove driver_lint_caps)
 - #155299 (make repr_transparent_non_zst_fields a hard error)
 - #155439 (Enable Cargo's new build-dir layout)
 - #157612 (Add a test where subtyping inhibits coercion.)
 - #157626 (Autogenerate unstable compiler flag stubs for unstable-book)
 - #157667 (Rename typing modes to better describe real usage)
 - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`)
 - #157342 (Reduce verbosity of cycle errors when possible)
 - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE)
 - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path)
 - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy)
 - #157698 (Remove an unnecessary cloning)
 - #157699 (Arg splat experiment - hir FnDecl impl)
 - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`)
 - #157722 (Move create_scope_map to rustc_codegen_ssa.)
 - #157725 (Keep generic suggestion for macro-expanded missing-type items)
 - #157733 (Remove old FIXMEs about nocapture attribute)
 - #157737 (Reorganize `tests/ui/issues` [7/N])
 - #157746 (supports_c_variadic_definitions: extend checklist for new targets)
 - #157763 (Move unused target expression error to appropriate place and rename it)
 - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 11, 2026
…sts, r=nikomatsakis

Add a regression test for an unconstrained TransmuteFrom ICE

rust-lang#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 rust-lang#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 rust-lang#151314
rust-bors Bot pushed a commit that referenced this pull request Jun 11, 2026
…uwer

Rollup of 23 pull requests

Successful merges:

 - #157716 (update Enzyme, June'26)
 - #149793 (Add inline asm support for amdgpu)
 - #155299 (make repr_transparent_non_zst_fields a hard error)
 - #155439 (Enable Cargo's new build-dir layout)
 - #157612 (Add a test where subtyping inhibits coercion.)
 - #157626 (Autogenerate unstable compiler flag stubs for unstable-book)
 - #157667 (Rename typing modes to better describe real usage)
 - #149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data)
 - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`)
 - #157342 (Reduce verbosity of cycle errors when possible)
 - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE)
 - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path)
 - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy)
 - #157698 (Remove an unnecessary cloning)
 - #157699 (Arg splat experiment - hir FnDecl impl)
 - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`)
 - #157722 (Move create_scope_map to rustc_codegen_ssa.)
 - #157725 (Keep generic suggestion for macro-expanded missing-type items)
 - #157733 (Remove old FIXMEs about nocapture attribute)
 - #157737 (Reorganize `tests/ui/issues` [7/N])
 - #157746 (supports_c_variadic_definitions: extend checklist for new targets)
 - #157763 (Move unused target expression error to appropriate place and rename it)
 - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
rust-bors Bot pushed a commit that referenced this pull request Jun 12, 2026
Rollup of 24 pull requests

Successful merges:

 - #157716 (update Enzyme, June'26)
 - #149793 (Add inline asm support for amdgpu)
 - #155299 (make repr_transparent_non_zst_fields a hard error)
 - #157612 (Add a test where subtyping inhibits coercion.)
 - #157626 (Autogenerate unstable compiler flag stubs for unstable-book)
 - #157667 (Rename typing modes to better describe real usage)
 - #149749 (Make `BorrowedBuf` and `BorrowedCursor` generic over the data)
 - #155113 (Ensure Send/Sync impl for std::process::CommandArgs)
 - #156212 (Additionally gate negative bounds behind new `-Zinternal-testing-features`)
 - #157342 (Reduce verbosity of cycle errors when possible)
 - #157366 (Add a regression test for an unconstrained TransmuteFrom ICE)
 - #157459 (rustc_target: callconv: powerpc64: Remove unreachable fallback code path)
 - #157658 (UnsafeCell: mention shared-ref-to-interior case, fix aliasing model inaccuracy)
 - #157698 (Remove an unnecessary cloning)
 - #157699 (Arg splat experiment - hir FnDecl impl)
 - #157713 (resolve: Remove exported imports from `maybe_unused_trait_imports`)
 - #157722 (Move create_scope_map to rustc_codegen_ssa.)
 - #157723 (Move uninhabited unreachable code lint to rustc_mir_transform)
 - #157725 (Keep generic suggestion for macro-expanded missing-type items)
 - #157733 (Remove old FIXMEs about nocapture attribute)
 - #157737 (Reorganize `tests/ui/issues` [7/N])
 - #157746 (supports_c_variadic_definitions: extend checklist for new targets)
 - #157763 (Move unused target expression error to appropriate place and rename it)
 - #157768 (codegen_ssa: peel trans. wrappers on scalable vecs)
@rust-bors rust-bors Bot merged commit b63b2d9 into rust-lang:main Jun 12, 2026
12 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 12, 2026
rust-timer added a commit that referenced this pull request Jun 12, 2026
Rollup merge of #157366 - johnproblems:add-ice-regression-tests, r=nikomatsakis

Add a regression test for an unconstrained TransmuteFrom ICE

#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
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]: layout_of: unexpected type _

4 participants