]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/type-mismatch-struct-field-shorthand.stderr
6bc16ba8b70fa927c25cc1657401649dce32f244
[rust.git] / src / test / ui / suggestions / type-mismatch-struct-field-shorthand.stderr
1 error[E0308]: mismatched types
2   --> $DIR/type-mismatch-struct-field-shorthand.rs:8:19
3    |
4 LL |     let _ = RGB { r, g, b };
5    |                   ^ expected f64, found f32
6 help: you can cast an `f32` to `f64` in a lossless way
7    |
8 LL |     let _ = RGB { r: r.into(), g, b };
9    |                   ^^^^^^^^^^^
10
11 error[E0308]: mismatched types
12   --> $DIR/type-mismatch-struct-field-shorthand.rs:8:22
13    |
14 LL |     let _ = RGB { r, g, b };
15    |                      ^ expected f64, found f32
16 help: you can cast an `f32` to `f64` in a lossless way
17    |
18 LL |     let _ = RGB { r, g: g.into(), b };
19    |                      ^^^^^^^^^^^
20
21 error[E0308]: mismatched types
22   --> $DIR/type-mismatch-struct-field-shorthand.rs:8:25
23    |
24 LL |     let _ = RGB { r, g, b };
25    |                         ^ expected f64, found f32
26 help: you can cast an `f32` to `f64` in a lossless way
27    |
28 LL |     let _ = RGB { r, g, b: b.into() };
29    |                         ^^^^^^^^^^^
30
31 error: aborting due to 3 previous errors
32
33 For more information about this error, try `rustc --explain E0308`.