summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/alias/ambiguous.rs
blob: 28409e0c662775a88d86f42b31ff0d573f98b08d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#![feature(trait_alias)]

mod inner {
    pub trait A { fn foo(&self); }
    pub trait B { fn foo(&self); }

    impl A for u8 {
        fn foo(&self) {}
    }
    impl B for u8 {
        fn foo(&self) {}
    }

    pub trait C = A + B;
}

use inner::C;

fn main() {
    let t = 1u8;
    t.foo(); //~ ERROR E0034

    inner::A::foo(&t); // ok
}