2018.03.08 — Lowering Planning
Goals

  • Enough structure for people to find tasks and execute on them
  • Figure out question around GAT

Compiler data structures

  • Can represent types and regions
  • No representation for Program Clauses
  • it includes binders
  • doesn’t have FromEnv
  • Rather than re-use, we will introduce types modeled on chalk
  • probably into librustc_traits crate
  • enum DomainGoal
  • enum Goal
  • enum ProgramClause
  • new rustc queries oriented around lowering that produce those data structures
  • program_clauses_implementing(DefId) — where def-id names a trait and this gives impls for that trait
  • program_clauses_for(DefId) — how is this structured?
  • the def-id might name a trait, impl, etc
  • all_program_clauses() root query ← probably start here for now but later refine
  • may want to try and avoid *this*
  • can start by unit testing these
  • #[rustc_dump_program_clause] attached to an item
  • emit to stderr or something, telling you what program clauses came out
  • MVP:
  • unit testing framework
  • the basic queries and types
  • given an impl, give back the program clauses
  • hold off then and have others do the rest of the rules

Other work items:
  • universe transition and canonicalization
  • rental inference context thing
  •  InferCtxtBuilder::new().enter(|infcx| { .. }) // only valid during this closure

Moving trait selection into a query:
  • FulfillmentContext is used directly by typeck
  • can we make it private to librustc::traits
  • maybe make a new wrapper TraitSolver

// in normal mode:

rustc_typeck -uses-> TraitSolver -delegates-to-> FulfillmentCtxt