]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/multidispatch-convert-ambig-dest.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / traits / multidispatch-convert-ambig-dest.rs
CommitLineData
1a4d82fc
JJ
1// Check that we get an error in a multidisptach scenario where the
2// set of impls is ambiguous.
3
4trait Convert<Target> {
5 fn convert(&self) -> Target;
6}
7
8impl Convert<i8> for i32 {
9 fn convert(&self) -> i8 {
10 *self as i8
11 }
12}
13
14impl Convert<i16> for i32 {
15 fn convert(&self) -> i16 {
16 *self as i16
17 }
18}
19
20fn test<T,U>(_: T, _: U)
21where T : Convert<U>
22{
23}
24
25fn 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
31fn main() {}