changed 4 years ago
Linked with GitHub

Type library plan

  • Shared type library
  • What are the differences to be reconciled?
    • TypeVisitor traits are a little different
      • adopt rustc's design with ControlFlow::Break/ControlFlow::Continue mentor this out
    • TypeFolder traits are a little different :)
      • adopt rustc's by-value design mentor this out (chalk#642)
      • remove cross-family folding (TargetInterner) mentor this out (chalk#643)
    • rustc: revert back to matching on ty.kind ?
      • in chalk we still have ty.kind(interner) as shorthand for &ty.data(interner).kind
      • this is not urgent, but we have this option
        • we would want to add a (conditional) Deref for interners which can access interned data without self
    • regions:
      • add ReErased, ReEmpty to chalk matthewjasper
    • region binders
      • ReFree used in lexical region resolve and for UserTypeAnnotation recording
        • solution: improve NLL higher-ranked region errors so that we can remove lexical region resolve
        • and figure out something for user-type-annotations
      • ReEarlyBound probably follows the TyParam work below
    • "late-bound" binders jack is pursuing this, god bless 'im :)
      • do we track indices, names, etc
      • current status:
        • we added rebind to track where the binders come from
        • audited the Binder::bind calls to figure out if they are dummies or "really binding", got the easy ones done but
    • type/const parameters niko will try
      • rustc uses TyParam and not placeholders, where do we want to change this?
      • Niko is doing some experimentation
    • dyn Trait representation XXX
      • chalk uses the binder setup
      • rustc ExistentialPredicate
      • try a chalk-style setup in rustc
        • might want to extract a WhereClause
        • ExistentialPredicate is almost a Binder<WhereClause>
    • optimize rust-analyzer folding of Substitution someone to verify
      • this may have changed once the TypeName change landed
  • Big steps
    • extract rustc library and start the factoring needs someone to start playing with it
      • what will the challenges be?
      • which types/traits/etc to pull out first?
      • easy first PR:
        • make library, extract some leaf types
  • Future consideration
    • require that interned data etc is copy?
      • more limited

sketch of what it will look like

type Ty<'tcx> = chalk_ir::Ty<TyCtxt<'tcx>>

there have to be some steps but it's hard to know them in advance

Select a repo