about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/assembly/ambiguity-due-to-uniquification-2.rs
blob: 30df70396f448004c0514c862f1d0034be100704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[current] check-pass

// Regression test from trait-system-refactor-initiative#27.

trait Trait<'t> {}
impl<'t> Trait<'t> for () {}

fn foo<'x, 'y>() -> impl Trait<'x> + Trait<'y> {}

fn impls_trait<'x, T: Trait<'x>>(_: T) {}

fn bar<'x, 'y>() {
    impls_trait::<'y, _>(foo::<'x, 'y>());
    //[next]~^ ERROR type annotations needed: cannot satisfy `impl Trait<'_> + Trait<'_>: Trait<'_>`
}

fn main() {}