]> git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/multidispatch-bad.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / traits / multidispatch-bad.rs
1 // Test that we detect an illegal combination of types.
2
3 trait Convert<Target> {
4 fn convert(&self) -> Target;
5 }
6
7 impl Convert<u32> for i32 {
8 fn convert(&self) -> u32 {
9 *self as u32
10 }
11 }
12
13 fn test<T,U>(_: T, _: U)
14 where T : Convert<U>
15 {
16 }
17
18 fn a() {
19 test(22i32, 44i32); //~ ERROR mismatched types
20 }
21
22 fn main() {}