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

Overlap rules

nikomatsakis opened this issue · comments

We need to model the overlap rules (excluding, for now, specialization). These rules work roughly like this:

Here is a list of work items:

  • #90
  • #88
  • Permit impls if the where-clauses are not provable, using the rules from re-balancing coherence
  • Support fundamental traits
  • Permit impls if the where-clauses have negative impls

The branch 2022-08-coherence includes some preliminary work here:

It introduces an overlap check and checks that the various impls that are in scope do not have types that successfully unify.

However, it has some problems:

  • it fails to detect two instances of the same impl and report an error
  • it doesn't include the check for where-clauses that are not provable as true