Skip to content

Encode direct const mir - #166435

Open
bit-aloo wants to merge 2 commits into
rust-lang:mainfrom
bit-aloo:2026-11-24-encode-direct-const-mir
Open

bit-aloo wants to merge 2 commits into
rust-lang:mainfrom
bit-aloo:2026-11-24-encode-direct-const-mir

Conversation

@bit-aloo

Copy link
Copy Markdown
Member

closes: #166409

For mir_for_ctfe we have two paths. One is for a const in the crate we are compiling. there we build the mir body ourselves, and if it's a direct const we synthesize it on the fly and continue. The other is for a const from another crate, there we don't build anything, we just look the body up in that crate's rmeta. For direct consts we were never storing that final mir body in the rmeta. So when a downstream crate used one as a value, the lookup found nothing and we 🧊 'd. So, now we are adding direct consts to mir_keys, so the encoder writes it in rmeta and it works

r? @khyperia

@rustbot

rustbot commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 Nov 24, 2026

This branch has not been deployed

No deployments
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: DefId(20:3 ~ up[3832]::N) does not have a "mir_for_ctfe"

3 participants