about summary refs log tree commit diff
path: root/tests/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs
blob: 0bf0d14c259da900d4839e5a94788c21fbe7891f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ check-fail

trait Bar<T> {
    fn bar(&self, _: T) {}
}

trait Foo: Bar<i32> + Bar<u32> {
    fn foo(&self, _: ()) {}
}

struct S;

impl Bar<i32> for S {}
impl Bar<u32> for S {}
impl Foo for S {}

fn main() {
    let s: &dyn Foo = &S;
    let t: &dyn Bar<_> = s; //~ ERROR mismatched types
}