-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue: Move to Chalk IR #8313
Labels
A-ty
type system / type inference / traits / method resolution
E-has-instructions
Issue has some instructions and pointers to code to get started
S-actionable
Someone could pick this issue up and work on it right now
Comments
I will start moving out the |
flodiebold
added
A-ty
type system / type inference / traits / method resolution
E-has-instructions
Issue has some instructions and pointers to code to get started
S-actionable
Someone could pick this issue up and work on it right now
labels
Apr 3, 2021
bors bot
added a commit
that referenced
this issue
Apr 4, 2021
8327: Move `Ty` creation methods out of `Ty` (Chalk move preparation) r=flodiebold a=flodiebold When we'll move to using `chalk_ir::Ty` (#8313), we won't be able to have our own inherent methods on `Ty` anymore, so we need to move the helpers elsewhere. This adds a `TyBuilder` that allows easily constructing `Ty` and related types (`TraitRef`, `ProjectionTy`, `Substitution`). It also replaces `SubstsBuilder`. `TyBuilder` can construct different things based on its type parameter; e.g. if it has an `AdtId`, we're constructing an ADT type, but if it has a `TraitId`, we're constructing a `TraitRef`. The common thing for all of them is that we need to build a `Substitution`, so the API stays the same for all of them except at the beginning and end. We also use `TyBuilder` to house various one-shot methods for constructing types, e.g. `TyBuilder::unit()`. Co-authored-by: Florian Diebold <[email protected]>
bors bot
added a commit
that referenced
this issue
Apr 5, 2021
8342: Rename `TyKind::Unknown` and `TyKind::ForeignType` (Chalk move) r=flodiebold a=lnicola CC #8313 Co-authored-by: Laurențiu Nicola <[email protected]>
I'll go for |
bors bot
added a commit
that referenced
this issue
Apr 5, 2021
8344: Pass interner to `ProjectionTy::self_type_parameter` and `TraitRef::self_type_parameter` r=flodiebold a=lnicola CC #8313 changelog skip Co-authored-by: Laurențiu Nicola <[email protected]>
bors bot
added a commit
that referenced
this issue
Apr 5, 2021
8348: Make `Binders` more like Chalk r=flodiebold a=flodiebold Working towards #8313. - hide `value` - use `VariableKinds` - adjust `subst` to be like Chalk's `substitute` - also clean up some other `TypeWalk` stuff to prepare for it being replaced by Chalk's `Fold` Co-authored-by: Florian Diebold <[email protected]>
I'll tackle |
bors bot
added a commit
that referenced
this issue
Apr 5, 2021
8356: Align more methods to Chalk r=flodiebold a=flodiebold Related to #8313. Move some inherent methods that don't exist in Chalk to an extension trait, remove some others. Co-authored-by: Florian Diebold <[email protected]>
@Veykril Great, keep in mind that for now we'll just always want to make them |
bors bot
added a commit
that referenced
this issue
Apr 5, 2021
8356: Align more methods to Chalk r=flodiebold a=flodiebold Related to #8313. Move some inherent methods that don't exist in Chalk to an extension trait, remove some others. Co-authored-by: Florian Diebold <[email protected]>
I'll do |
bors bot
added a commit
that referenced
this issue
Apr 5, 2021
8358: Align FnPointer with Chalk r=flodiebold a=flodiebold CC #8313 Co-authored-by: Florian Diebold <[email protected]>
bors bot
added a commit
that referenced
this issue
Apr 6, 2021
8359: Add Lifetime to TyKind::Ref and DynTy r=flodiebold a=Veykril CC #8313 Co-authored-by: Lukas Wirth <[email protected]>
I'll move the accessors to the extension trait |
bors bot
added a commit
that referenced
this issue
Apr 6, 2021
8366: Add chalk_ir::Const to TyKind::Array r=flodiebold a=Veykril CC #8313 Co-authored-by: Lukas Wirth <[email protected]>
bors bot
added a commit
that referenced
this issue
Apr 6, 2021
8368: Move Ty accessors to TyExt r=flodiebold a=Veykril CC #8313 Co-authored-by: Lukas Wirth <[email protected]>
bors bot
added a commit
that referenced
this issue
Apr 7, 2021
8396: Uncouple Ty::builtin_deref and Ty::def_crates from Ty r=Veykril a=Veykril bors r+ CC #8313 Co-authored-by: Lukas Wirth <[email protected]>
I'm doing the remaining |
bors bot
added a commit
that referenced
this issue
Apr 7, 2021
8409: Various remaining fixes for Chalk IR move r=flodiebold a=flodiebold CC #8313 Co-authored-by: Florian Diebold <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-ty
type system / type inference / traits / method resolution
E-has-instructions
Issue has some instructions and pointers to code to get started
S-actionable
Someone could pick this issue up and work on it right now
We want to get rid of our own representations of types and related data in hir_ty (like
Ty
,TraitRef
and so on), and instead use the versions fromchalk_ir
everywhere. This is a rather large refactoring, and to achieve it without doing a gigantic PR that takes months, we're gradually aligning our own representations to look like the Chalk versions, with the goal that in the end we can mostly just definetype Ty = chalk_ir::Ty<Interner>
and be done.We're actually getting close to this goal; I tried it to see where we are currently and we're at about 400 errors when doing the switch. Going through those errors, I found the following remaining tasks:
Substitution::interned
(I added it wrongly)Ty
inherent methods to free-standing, extension trait or builder (except those that exist on Chalk'sTy
as well)is_xxx
andas_xxx
and similar accessors should move to extension traitequals_ctor
andbuiltin_deref
can be free-standing in the modules where they're usedsubsts
andsubsts_mut
would ideally be removedSubstitution
(justprefix
andsuffix
remaining)TyKind::Unknown
->Error
TyKind::ForeignType
->Foreign
Lifetime
to be more like Chalk (i.e. there's aninterned
method that contains the actual enum)self_type_parameter
takes Interner (onTraitRef
andProjectionTy
)Binders
value
accesses, useVariableKinds
instead of just a usizeVariableKinds
with a number of type vars, since that's all we ever do right nowBinders::subst
with Chalk'ssubstitute
Substitution
internals, which are still getting accessed in lots of placesTyKind::Ref
,TyKind::Array
,DynTy
FnPointer
: removenum_args
, addnum_binders
(those are not the same), addFnSubst
,substs
->substitution
SolutionVariables
InferenceVar
totypes
module and align it with the Chalk version (to_inner
/from_inner
should probably become free-standing functions inunify.rs
Note that lots of these can be easily done with structural search & replace!
The text was updated successfully, but these errors were encountered: