]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/multidispatch-bad.rs
Auto merge of #101017 - JohnTitor:rollup-73f2fhb, r=JohnTitor
[rust.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() {}