]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Check that we get an error in a multidisptach scenario where the |
2 | // set of impls is ambiguous. | |
3 | ||
4 | trait Convert<Target> { | |
5 | fn convert(&self) -> Target; | |
6 | } | |
7 | ||
8 | impl Convert<i8> for i32 { | |
9 | fn convert(&self) -> i8 { | |
10 | *self as i8 | |
11 | } | |
12 | } | |
13 | ||
14 | impl Convert<i16> for i32 { | |
15 | fn convert(&self) -> i16 { | |
16 | *self as i16 | |
17 | } | |
18 | } | |
19 | ||
20 | fn test<T,U>(_: T, _: U) | |
21 | where T : Convert<U> | |
22 | { | |
23 | } | |
24 | ||
25 | fn a() { | |
d9579d0f | 26 | test(22, std::default::Default::default()); |
3c0e092e XL |
27 | //~^ ERROR type annotations needed |
28 | //~| ERROR type annotations needed | |
1a4d82fc JJ |
29 | } |
30 | ||
31 | fn main() {} |