summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/do-not-mention-type-params-by-name-in-suggestion-issue-96292.rs
blob: 205b1173e079f5ea2596e6fe453ea59cbfa8063d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
struct Thing<X>(X);

trait Method<T> {
    fn method(self, _: i32) -> T;
}

impl<X> Method<i32> for Thing<X> {
    fn method(self, _: i32) -> i32 { 0 }
}

impl<X> Method<u32> for Thing<X> {
    fn method(self, _: i32) -> u32 { 0 }
}

fn main() {
    let thing = Thing(true);
    thing.method(42); //~ ERROR type annotations needed
}