- 
                Notifications
    You must be signed in to change notification settings 
- Fork 19
Open
Labels
roadmap-tracking-issueTracks an item on our types team roadmap.Tracks an item on our types team roadmap.
Description
This is a tracking issue for the goal of creating a shared library that represents Rust types. This library should be used by rustc, chalk, and rust-analyzer, and would permit us to pass data and goals between rustc and chalk without any "bridging" cost. It will also permit one to write type-based analyses (like chalk itself!) that do not depend on rustc internals.
What follows is a list of steps to be taken. Those steps with open issues are actionable and ready to go. Those without open issues may be uncertain or maybe we just didn't write up any notes yet -- feel free to ping on Zulip to inquire after the status.
General work items
- Initial design meeting proposal
- Propose renaming "type fold" to "type map" (in both rustc/chalk)
- Propose renaming "type visitor" to "type folder" (in both rustc/chalk, although we don't have a trait like this in chalk yet)
- Complete comparison spreadsheet that describes names for things in rustc, chalk and what should go into shared library
Rust work items
-  Refactor code in rustc using ty.kindto use a methodty.kind(tcx)(but see bikeshed point above)
-  Extend rustc's Bindertype to contain a list of "kinds" for the bound items (discussion)
-  return TyKindby value (maybe) as proposed in Make TyKind Copy and change ty.kind() to return TyKind instead of &TyKind compiler-team#363
- Extend rustc's late-bound types to contain an index
- Start to move types into library to figure out what is missing
-  Introduce custom derive for Foldtrait
-  Extend Rustc's folder trait to have a Resultassociated type
- Extend Rustc's visit trait to not hard-code a boolean result?
-  Extend Rustc's TyKindvariant to collapse the various scalars into one
Chalk work items
-  Rename TyDatatoTyKindin Chalk
- Count binders, not variables
-  Extend TypeNamewith variants representing scalar types (e.g.,bool,u32,i32) and other rust "application types" extend chalkTypeNamewith builtin types chalk#368
-   Introduce Internerassociated type for all vectors that appear in chalk_ir types (e.g.,Vec<QuantifiedWhereClause>,Vec<ParameterKind>, etc) as well asArcorBoxmove remaining vectors, boxes in chalk-ir into associated types onInternerchalk#369
-  Convert parametersfield ofFntype to useSubstitutioninstead of aVec
-   Introduce a Visittrait in chalk introduce aVisittrait to go withFoldchalk#333
-  Refactor BindersAPI to have private values field -- refactor Binders API to have a private value field chalk#375
-  Add "flags" to the Tytype and friends and integrate some of those flags into folders add flags toInternedTyandInternedRegiontypes chalk#627- Add
- Integrate -- not really a blocker
 
- Optimize folding over slices to avoid "reinterning" them when not needed
-  Experiment with removing ApplyandTypeNameand inlining those as distinct variants in chalk's type
Things to explore
- Align on a single model of canonicalization -- what gets canonicalized? What about universe canonicalization?
Metadata
Metadata
Assignees
Labels
roadmap-tracking-issueTracks an item on our types team roadmap.Tracks an item on our types team roadmap.