Open lcnr opened 1 year ago
a purely structural lookup is difficult to support in MIR typeck because we replace all regions with new variables.
a semantic lookup requires some special care to correctly handle universes. It also breaks the following example
trait Trait<'a, 'b> {} impl<'a, 'b, T> Trait<'a, 'b> for T {} #[derive(Copy, Clone)] struct Inv<'a>(*mut &'a ()); fn foo<'a, 'b>(x: Inv<'a>, y: Inv<'b>, b: bool) -> impl Trait<'a, 'b> { if b { let _: Inv<'b> = foo(y, x, false); } x }
if we uniquify regions the lookup will have to be semantic
a purely structural lookup is difficult to support in MIR typeck because we replace all regions with new variables.
a semantic lookup requires some special care to correctly handle universes. It also breaks the following example