rust-lang / a-mir-formality

a model of MIR and the Rust type/trait system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

refactor decl grammar to be more Rust like

nikomatsakis opened this issue · comments

I've been pondering the "decl layer". I think it might be a bit more readable if we made efforts to make it a touch more Rust like.

I thought we could collect ideas here in this tracking issue.

  • #45
  • #46
  • embed item names in the declarations
  • make Self type parameter implicit on traits
  • #21

Some examples that came up in discussion today:

To represent static S: Foo = f-body, instead of

(StaticDecl (term (S (static () () (rigid-ty Foo ()) fn-body))))

we could do

(StaticDecl (term (static S () : (rigid-ty Foo ()) = fn-body where ())))

Note that this syntax supports generic statics/consts with where-clauses :)