Skip to content

Add regression test for #135287#155191

Closed
blackms wants to merge 1 commit intorust-lang:mainfrom
blackms:add-regression-test-135287
Closed

Add regression test for #135287#155191
blackms wants to merge 1 commit intorust-lang:mainfrom
blackms:add-regression-test-135287

Conversation

@blackms
Copy link
Copy Markdown

@blackms blackms commented Apr 12, 2026

Fixes #135287

The ICE (adt_sized_constraint called on non-struct type) triggered when changing a struct to an enum under incremental compilation. It was fixed indirectly by the removal of the adt_sized_constraint query in #122493, but no regression test was added.

This adds one using the minimized reproducer from the issue.

r? incremental

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 12, 2026

The review request incremental corresponds to 1 reviewer(s).
However, none of them are available for a review at this time.
Use r? to specify someone else to assign.

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

rustbot commented Apr 12, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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:

  • Fallback group: @Mark-Simulacrum, @jieyouxu
  • @Mark-Simulacrum, @jieyouxu expanded to Mark-Simulacrum, jieyouxu

@rustbot

This comment has been minimized.

@@ -0,0 +1,67 @@
// Regression test for #135287.
Copy link
Copy Markdown
Member

@Kivooeo Kivooeo Apr 12, 2026

Choose a reason for hiding this comment

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

View changes since the review

use a link to an issue instead of just issue number

Copy link
Copy Markdown
Member

@Kivooeo Kivooeo left a comment

Choose a reason for hiding this comment

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

also please move it to one of tests/ui directories and remove "issue-n" from test name and remove issue number from commit message

View changes since this review

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

rustbot commented Apr 12, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Kivooeo Kivooeo assigned Kivooeo and unassigned Mark-Simulacrum Apr 12, 2026
…lation

The ICE (`adt_sized_constraint called on non-struct type`) was fixed
indirectly by the removal of the `adt_sized_constraint` query, but no
regression test was added. This adds one using the minimized reproducer
from the original report.
@blackms blackms force-pushed the add-regression-test-135287 branch from 1921e8b to 8b543ce Compare April 14, 2026 13:32
@blackms
Copy link
Copy Markdown
Author

blackms commented Apr 14, 2026

Thanks for the review @Kivooeo! Addressed in the latest push:

  • Renamed file to adt-sized-constraint-on-enum.rs (dropped the issue-N- prefix).
  • Inline comment now uses the full issue URL instead of #135287.
  • Commit message rewritten to drop the #135287 / #122493 references, keeping only a description of what the test exercises.

One thing I'd like to push back on gently: I'd prefer to keep the test in tests/incremental/ rather than move it under tests/ui/. The bug is specifically an ICE that happens when the same crate is recompiled across two builds that toggle a type definition between struct and enum — it requires the incremental cache from cfail1 to be reused by cfail2, which is exactly what tests/incremental/ is wired up to do. In tests/ui/ with //@ incremental, each revision recompiles from a clean cache, so the offending query wouldn't be hit in the stale-on-disk state that originally triggered the ICE. Happy to move it if you disagree — just wanted to flag the reasoning first.

@rustbot ready

@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 Apr 14, 2026
@jieyouxu
Copy link
Copy Markdown
Member

See #155296 (comment)

@jieyouxu jieyouxu closed this Apr 15, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 15, 2026
@rust-lang rust-lang locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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.

adt_sized_constraint called on non-struct type

5 participants