Proposal
Change all queries which currently have a bound_X variant to return EarlyBinder<T> by default and remove the bound_X version. Add a method fn EarlyBinder::<T>::subst_identity(self) -> T if these queries are used in the identity context and don't need to actually substitute anything.
Not having EarlyBinder be the default can very easily result in incorrect uses of these queries, e.g. https://github.com/rust-lang/rust/blob/736c675d2ab65bcde6554e1b73340c2dbc27c85a/compiler/rustc_hir_analysis/src/astconv/mod.rs#L2720 which I found while reviewing rust-lang/rust#101947. The normalize_ty normalizes type_of(def_id) in the wrong environment as we only call subst afterwards.
Mentors or Reviewers
I am available to mentor and review this work.
Process
The main points of the Major Change Process are as follows:
You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
Proposal
Change all queries which currently have a
bound_Xvariant to returnEarlyBinder<T>by default and remove thebound_Xversion. Add a methodfn EarlyBinder::<T>::subst_identity(self) -> Tif these queries are used in the identity context and don't need to actually substitute anything.Not having
EarlyBinderbe the default can very easily result in incorrect uses of these queries, e.g. https://github.com/rust-lang/rust/blob/736c675d2ab65bcde6554e1b73340c2dbc27c85a/compiler/rustc_hir_analysis/src/astconv/mod.rs#L2720 which I found while reviewing rust-lang/rust#101947. Thenormalize_tynormalizestype_of(def_id)in the wrong environment as we only callsubstafterwards.Mentors or Reviewers
I am available to mentor and review this work.
Process
The main points of the Major Change Process are as follows:
@rustbot second.-C flag, then full team check-off is required.@rfcbot fcp mergeon either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.