Skip to content

should looking up the defined opaque types be structural or semantic #17

Open
@lcnr

Description

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
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    not-blocking-coherenceAn issue we can resolve after stabilizing the new solver during coherence

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions