Skip to content

Encode the name instead of index in EnumVariantId#22329

Merged
Veykril merged 3 commits into
rust-lang:masterfrom
ChayimFriedman2:intern-ref
May 13, 2026
Merged

Encode the name instead of index in EnumVariantId#22329
Veykril merged 3 commits into
rust-lang:masterfrom
ChayimFriedman2:intern-ref

Conversation

@ChayimFriedman2

Copy link
Copy Markdown
Contributor

The most important reason is incrementality. While not a lot of things depend on the stability of EnumVariantId, it's still useful to have them stable.

However it turns out that many things actually do want the name, more than those that want the index.

Best reviewed commit by commit. Blocked on #22328.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 10, 2026
@ChayimFriedman2 ChayimFriedman2 marked this pull request as draft May 10, 2026 01:01
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 10, 2026
The most important reason is incrementality. While not a lot of things depend on the stability of `EnumVariantId`, it's still useful to have them stable.

However it turns out that many things actually do want the name, more than those that want the index.
`ThinVec` doesn't allocate when empty.
@ChayimFriedman2 ChayimFriedman2 marked this pull request as ready for review May 11, 2026 09:44
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 11, 2026
@Veykril Veykril added this pull request to the merge queue May 13, 2026
Merged via the queue into rust-lang:master with commit 8d1edc4 May 13, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 13, 2026
@ChayimFriedman2 ChayimFriedman2 deleted the intern-ref branch May 13, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants