Combine ty::Opaque
and ty::Projection
into ty::Alias
#79
Labels
final-comment-period
The FCP has started, most (if not all) team members are in agreement
major-change
A major change proposal
T-types
Add this label so rfcbot knows to poll the types team
to-announce
Announce this issue on triage meeting
Combine
ty::Opaque
andty::Projection
intoty::Alias
Aims to combine
ty::Opaque
andty::Projection
intoty::Alias
. Both are just a def-id and set of substitutions. We should also be able to easily add new alias variants in the future if needed.The new
TyKind
API will somewhat look like:To make sure that code can still match on the old usages
ty::Opaque
andty::Projection
, we distinguish the variants withAliasKind
. This is important in places where we don't have access toTyCtxt
, such as flags computation. Also, it would be somewhat expensive to add new def-id comparisons.This means most match sites can go from
ty::Projection(proj)
toty::Alias(ty::Projection, proj)
, meaning the refactor will be mostly mechanical.The API is somewhat different from the way that Chalk does it, where
AliasTy
is an enum with a data-fulProjection
andOpaque
variant: https://docs.rs/chalk-ir/0.87.0/chalk_ir/enum.AliasTy.htmlMentors or Reviewers
@compiler-errors's implementation: rust-lang/rust@master...compiler-errors:rust:opaques
still needs some cleaning, but only took like an hour or so.. also we might want to tweak the API a bit...
The change is mostly mechanical, so anyone on the team can review.
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 merge
on 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.
The text was updated successfully, but these errors were encountered: