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

extract-solution vs nested substitutions

mattheww opened this issue · comments

I tried adding a test similar to the U <: &'a T one in test-subtyping.rkt, for U <: &'a mut T.

It fails with a 'not in my domain' error from known-relations, which I think means its precondition is failing.

The Substitutions returned from logic:prove-top-level-goal/cosld include the following:

  TheTy«44»1 : T
  U          : (rigid-ty (ref mut) (TheLt«43»1 TheTy«44»1))

I think the problem is that the functions in solution.rkt which apply these substitutions run only a single pass, so they don't always cope with a situation where a substitution's Parameter contains a further substitutable variable.

If I bodge solution.rkt up to run apply-substitution-from-env twice in a couple of places, the test passes.

See my 2022-10_ref_mut_subtype branch for the changes I made.

This issue applied to the Redex version of a-mir-formality, which is now gone.