Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lcnr opened this issue May 24, 2023 · 1 comment
Open
Labels
not-blocking-coherence An issue we can resolve after stabilizing the new solver during coherence

Comments

@lcnr
Copy link
Contributor

lcnr commented May 24, 2023

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
}
@lcnr
Copy link
Contributor Author

lcnr commented Jun 12, 2023

if we uniquify regions the lookup will have to be semantic

@lcnr lcnr added the not-blocking-coherence An issue we can resolve after stabilizing the new solver during coherence label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-blocking-coherence An issue we can resolve after stabilizing the new solver during coherence
Projects
None yet
Development

No branches or pull requests

1 participant