rust-lang / types-team

Home of the "types team", affiliated with the compiler and lang teams.
https://rust-lang.github.io/types-team/
Apache License 2.0
96 stars 19 forks source link

align chalk and rustc dyn representation #30

Open nikomatsakis opened 3 years ago

nikomatsakis commented 3 years ago

chalk represents dyn Trait using binders, so that for dyn Debug, you have a predicate like <T> T: Debug (here, the bound variable T represents the self type).

rustc uses ExistentialPredicate.

The chalk way seems superior. Better to not have an extra form of predicate.

The goal would be to refactor rustc to use a binder + predicate.

nikomatsakis commented 3 years ago

We may want to refactor rustc to have a WhereClause; ExistentialPredicate is almost a Binder<WhereClause>

csmoe commented 3 years ago

@rustbot claim

nikomatsakis commented 3 years ago

@csmoe note that this probably requires an MCP.

csmoe commented 3 years ago

okay, I'll create that.