Skip to content

Conversation

@mu001999
Copy link
Contributor

@mu001999 mu001999 commented Jan 18, 2026

Fixes #151251

With feature generic_const_exprs enabled, consts with #[type_const] won't be normalized even if they need. Then ICE happens when CTFE tries to evaluate such const without body.

Fix this by normalizing such consts even with feature generic_const_exprs enabled.

r? @BoxyUwU

@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2026

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

@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 Jan 18, 2026
@mu001999 mu001999 marked this pull request as draft January 18, 2026 02:10
@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 Jan 18, 2026
@mu001999 mu001999 changed the title Return evaluated type-const when eval_to_valtree Normalize type_const items even with feature generic_const_exprs Jan 18, 2026
@rust-log-analyzer

This comment has been minimized.

@mu001999 mu001999 marked this pull request as ready for review January 18, 2026 06:11
@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 Jan 18, 2026
@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 18, 2026

@bors r+ rollup

thanks :)

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 18, 2026

📌 Commit 7510f74 has been approved by BoxyUwU

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 18, 2026
@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 18, 2026

Though for future reference, if a problem with mGCA is only reproducible with generic_const_exprs then I think it's usually not worth fixing. It depends a little on whether we expect the underlying problem to occur with other const generics features or not (which can be kinda hard to judge).

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 18, 2026
Normalize type_const items even with feature `generic_const_exprs`

Fixes rust-lang#151251

With feature `generic_const_exprs` enabled, consts with `#[type_const]` won't be normalized even if they need. Then ICE happens when CTFE tries to evaluate such const without body.

Fix this by normalizing such consts even with feature `generic_const_exprs` enabled.

r? @BoxyUwU
rust-bors bot pushed a commit that referenced this pull request Jan 18, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #150767 (Allow invoking all help options at once)
 - #150886 (Added mGCA related tests)
 - #151245 (Explicitly list crate level attrs)
 - #151268 (Fix ICE on inconsistent import resolution with macro-attributed extern crate)
 - #151275 (Normalize type_const items even with feature `generic_const_exprs`)
 - #151288 (Use `find_attr` instead of `attr::contains_name` in `lower_const_item_rhs`)
 - #151321 (Port #![no_main] to the attribute parser.)

r? @ghost
@rust-bors rust-bors bot merged commit 9f49af8 into rust-lang:main Jan 18, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 18, 2026
rust-timer added a commit that referenced this pull request Jan 18, 2026
Rollup merge of #151275 - fix/151251, r=BoxyUwU

Normalize type_const items even with feature `generic_const_exprs`

Fixes #151251

With feature `generic_const_exprs` enabled, consts with `#[type_const]` won't be normalized even if they need. Then ICE happens when CTFE tries to evaluate such const without body.

Fix this by normalizing such consts even with feature `generic_const_exprs` enabled.

r? @BoxyUwU
@mu001999 mu001999 deleted the fix/151251 branch January 19, 2026 06:59
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: CTFE tried to evaluate type-const (cyclic type_const)

4 participants