]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/multidispatch-bad.rs
Merge commit '0969bc6dde001e01e7e1f58c8ccd7750f8a49ae1' into sync_cg_clif-2021-03-29
[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() {}