summaryrefslogtreecommitdiffstats
path: root/tests/ui/inference/need_type_info/concrete-impl.rs
blob: fc79e6201bdb85755cfc9ec26e25b61a9cfc8cd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
trait Ambiguous<A> {
    fn method() {}
}

struct One;
struct Two;
struct Struct;

impl Ambiguous<One> for Struct {}
//~^ NOTE multiple `impl`s satisfying `Struct: Ambiguous<_>` found
impl Ambiguous<Two> for Struct {}

fn main() {
    <Struct as Ambiguous<_>>::method();
    //~^ ERROR type annotations needed
    //~| NOTE cannot infer type of the type parameter `A`
    //~| ERROR type annotations needed
    //~| NOTE infer type of the type parameter `A`
}