-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
implement rust-lang/types-team#78
Change all queries which currently have a
bound_X
variant to returnEarlyBinder<T>
by default and remove thebound_X
version. Add a methodfn 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.which I found while reviewing #101947. The
EarlyBinder(self.normalize_ty(span, tcx.at(span).type_of(def_id))) normalize_ty
normalizestype_of(def_id)
in the wrong environment as we only callsubst
afterwards.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.