summaryrefslogtreecommitdiffstats
path: root/tests/ui/inference/need_type_info/issue-109905.rs
blob: 99d10a5eae047165fed183712301c32bfd81709d (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
25
// Test that we show the correct type parameter that couldn't be inferred and that we don't
// end up stating nonsense like "type parameter `'a`" which we used to do.

trait Trait<'a, T> {
    fn m(self);
}

impl<'a, A> Trait<'a, A> for () {
    fn m(self) {}
}

fn qualified() {
    <() as Trait<'static, _>>::m(());
    //~^ ERROR type annotations needed
    //~| NOTE cannot infer type of the type parameter `T`

}

fn unqualified() {
    Trait::<'static, _>::m(());
    //~^ ERROR type annotations needed
    //~| NOTE cannot infer type of the type parameter `T`
}

fn main() {}