Open nikomatsakis opened 4 years ago
Michael has made many PRs towards this effort!: rust-lang/rust#116828 rust-lang/rust#116912 rust-lang/rust#116946 rust-lang/rust#116951 rust-lang/rust#116993 rust-lang/rust#117008 rust-lang/rust#117578 rust-lang/rust#117580 rust-lang/rust#117582 rust-lang/rust#117851
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
Rust work items
ty.kind
to use a methodty.kind(tcx)
(but see bikeshed point above)Binder
type to contain a list of "kinds" for the bound items (discussion)TyKind
by value (maybe) as proposed in https://github.com/rust-lang/compiler-team/issues/363Fold
traitResult
associated typeTyKind
variant to collapse the various scalars into oneChalk work items
TyData
toTyKind
in ChalkTypeName
with variants representing scalar types (e.g.,bool
,u32
,i32
) and other rust "application types" https://github.com/rust-lang/chalk/issues/368Interner
associated type for all vectors that appear in chalk_ir types (e.g.,Vec<QuantifiedWhereClause>
,Vec<ParameterKind>
, etc) as well asArc
orBox
https://github.com/rust-lang/chalk/issues/369parameters
field ofFn
type to useSubstitution
instead of aVec
Visit
trait in chalk https://github.com/rust-lang/chalk/issues/333Binders
API to have private values field -- https://github.com/rust-lang/chalk/issues/375Ty
type and friends and integrate some of those flags into folders https://github.com/rust-lang/chalk/issues/627Apply
andTypeName
and inlining those as distinct variants in chalk's typeThings to explore
XXX hackmd where sketched a plan, need to incorporate above