about summary refs log tree commit diff
path: root/tests/ui/impl-trait/non-defining-uses/multiple-opaques-ambig.rs
blob: e7aaf6fa135a9e6420d4216fba554035b422737b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)
//@ check-pass
#![allow(unconditional_recursion)]

// Regression test for trait-system-refactor-initiative#182. If multiple
// opaque types result in different item bounds, do not apply them.

trait Trait<T> {}
impl<T, U> Trait<T> for U {}

fn impls_trait<T: Trait<U>, U>(_: T) -> U {
    todo!()
}

fn overlap<T, U>() -> (impl Trait<T>, impl Trait<U>) {
    let mut x = overlap::<T, U>().0;
    x = overlap::<T, U>().1;
    let u = impls_trait(x);
    let _: u32 = u;
    ((), ())
}
fn main() {}