Skip to content

opaque type universal args cannot depend on member constraints #16

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

Open
lcnr opened this issue Apr 8, 2025 · 0 comments
Open

opaque type universal args cannot depend on member constraints #16

lcnr opened this issue Apr 8, 2025 · 0 comments

Comments

@lcnr
Copy link
Owner

lcnr commented Apr 8, 2025

#[derive(Copy, Clone)]
struct Inv<'a>(*mut &'a ());
fn mk<'a>() -> Inv<'a> {
    loop {}
}

fn scope<'a, 'b, 'c>(
    a: Inv<'a>,
    b: Inv<'b>,
    c: Inv<'c>,
) -> (impl Sized + use<'c>, impl Sized + use<'a, 'b>) {
    loop {
        let _0 = mk();
        let _1 = mk();
        // small: opaque1<'b>
        // big: opaque2<'a, '0>
        let (mut small, mut big) = scope(a, _0, b);
        // opaque1<'b> = Inv<'0>
        // member constraint DOES NOT equate '0 with 'b
        // it only adds 'b to the region value of '0
        small = _0;
        // opaque2<'a, '0> = Inv<'1>;
        // when checking whether an arg is universal we first
        // check whether its scc representative is a free region.
        big = a;
    }
    scope(a, b, c)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant