]> git.lizzy.rs Git - rust.git/blob - src/test/ui/argument-suggestions/formal-and-expected-differ.rs
Make some diagnostics not depend on the source of what they reference being available
[rust.git] / src / test / ui / argument-suggestions / formal-and-expected-differ.rs
1 pub trait Foo {
2     type T;
3 }
4
5 impl Foo for i32 {
6     type T = f32;
7 }
8
9 pub struct U<T1, T2>(T1, S<T2>)
10 where
11     T1: Foo<T = T2>;
12
13 pub struct S<T>(T);
14
15 fn main() {
16     // The error message here isn't great -- it has to do with the fact that the
17     // `expected_inputs_for_expected_output` deduced inputs differs from the inputs
18     // that we infer from the constraints of the signature.
19     //
20     // I am not really sure what the best way of presenting this error message is,
21     // since right now it just suggests changing `3u32` <=> `3f32` back and forth.
22     let _: U<_, u32> = U(1, S(3u32));
23     //~^ ERROR mismatched types
24     //~| ERROR mismatched types
25 }