Skip to content

Rename UnevaluatedConst to AliasConst#158115

Draft
Shourya742 wants to merge 2 commits into
rust-lang:mainfrom
Shourya742:2026-06-19-rename-unevaluatedConst-to-aliasconst
Draft

Rename UnevaluatedConst to AliasConst#158115
Shourya742 wants to merge 2 commits into
rust-lang:mainfrom
Shourya742:2026-06-19-rename-unevaluatedConst-to-aliasconst

Conversation

@Shourya742

Copy link
Copy Markdown
Member

refer: rust-lang/project-const-generics#115

r? @khyperia

I only renamed the type system version to AliasConst/AliasConstKind. I did not rename MIR’s UnevaluatedConst, it currently holds direct def_id instead of kind variant we have in type-system. I also left rustc_public’s UnevaluatedConst unchanged.

@rustbot

rustbot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

changes to the core type system

cc @lcnr

Some changes occurred in const_evaluatable.rs

cc @BoxyUwU

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Some changes occurred in match checking

cc @Nadrieril

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

Some changes occurred in rustc_ty_utils::consts.rs

cc @BoxyUwU

HIR ty lowering was modified

cc @fmease

changes to the core type system

cc @lcnr

@rustbot

rustbot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Failed to set assignee to khyperia: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@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 19, 2026
@Shourya742 Shourya742 marked this pull request as draft June 19, 2026 03:48
@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 Jun 19, 2026
@rust-cloud-vms rust-cloud-vms Bot force-pushed the 2026-06-19-rename-unevaluatedConst-to-aliasconst branch from 73249cb to bea205a Compare June 19, 2026 04:38
@rust-log-analyzer

This comment has been minimized.

@khyperia

khyperia commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

thanks so much for working on this! ❤️

there's some more stuff that we want to rename related to this change (sorry for not being more clear in the issue description!):

  • ConstKind::Unevaluated (variant that just holds a UnevaluatedConst, its name should reflect what it contains)
  • Const::new_unevaluated (constructor for the previous variant)
    • (and the Interner trait for new_unevaluated)
  • Interner::UnevaluatedConstId (this one is a bit sketch, I believe it's actually only used for anon consts, not all AliasConsts, so it should possibly be renamed to AnonConstId instead of AliasConstId. Please double check for me though and make a judgement call!)
  • perhaps little things like AliasTerm::to_term has a local named unevaluated_const, some other places also call local variables unevaluated. This is less important though, IMO!
    • same thing that we have a relatively consistent naming that variables of type UnevaluatedConst are called uv, could possibly rename those as uv no longer makes sense. But, it's not as important, we can also clean this up over time, IMO.
  • lots of comments referring to Unevaluated that could be rephrased if you'd like (it'd be nice to not have to know the legacy information that these things used to be called unevaluated consts while reading comments, but not strictly necessary to update I suppose)
  • I need to remember to update the rustc dev guide (but honestly that's on me, that page is pretty out of date after my recent refactorings, I've been forgetting to update it)

I discovered the above list by running rg -i unevaluated in compiler/, and being like, "hmm, does this mention of the word 'unevaluated' have to do with the concept of UnevaluatedConst, or is it just talking about something in general being unevaluated? (and ignoring mir and rustc_public's UnevaluatedConst)". (Just letting you know so you can do the same kind of thing if you'd like! I might have missed some stuff)

Would you like to work on all this other stuff in phases, or would you rather do everything in one big PR? Up to you I think!

@Shourya742

Copy link
Copy Markdown
Member Author

Would you like to work on all this other stuff in phases, or would you rather do everything in one big PR? Up to you I think!

Thanks for thorough review and suggestions. I would like to get them in, in this PR itself (would be scary to ping these many people again). I will make sure to add commits for each update for easier review. I will reach out, if I have some doubts. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants