]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/do-not-mention-type-params-by-name-in-suggestion-issue-96292.rs
Add regression test for #82830
[rust.git] / src / test / ui / traits / do-not-mention-type-params-by-name-in-suggestion-issue-96292.rs
1 struct Thing<X>(X);
2
3 trait Method<T> {
4     fn method(self, _: i32) -> T;
5 }
6
7 impl<X> Method<i32> for Thing<X> {
8     fn method(self, _: i32) -> i32 { 0 }
9 }
10
11 impl<X> Method<u32> for Thing<X> {
12     fn method(self, _: i32) -> u32 { 0 }
13 }
14
15 fn main() {
16     let thing = Thing(true);
17     thing.method(42);
18     //~^ ERROR type annotations needed
19     //~| ERROR type annotations needed
20 }