about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/opaques/different-bound-vars.rs
blob: 5801a5edeb4abfd0bda50800ab69f384818da4f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Check whether we support defining uses with different bound vars.
// This needs to handle both mismatches for the same opaque type storage
// entry, but also between different entries.

//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@[next] check-pass

fn foo<T, U>(b: bool) -> impl Sized {
    if b {
        let _: for<'a> fn(&'a ()) = foo::<T, U>(false);
        let _: for<'b> fn(&'b ()) = foo::<U, T>(false);
        //[current]~^ ERROR concrete type differs from previous defining opaque type use
    }

    (|&()| ()) as for<'c> fn(&'c ())
}

fn main() {}