]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/numeric-literal-cast.stderr
Rollup merge of #106860 - anden3:doc-double-spaces, r=Dylan-DPC
[rust.git] / tests / ui / mismatched_types / numeric-literal-cast.stderr
1 error[E0308]: mismatched types
2   --> $DIR/numeric-literal-cast.rs:6:9
3    |
4 LL |     foo(1u8);
5    |     --- ^^^ expected `u16`, found `u8`
6    |     |
7    |     arguments to this function are incorrect
8    |
9 note: function defined here
10   --> $DIR/numeric-literal-cast.rs:1:4
11    |
12 LL | fn foo(_: u16) {}
13    |    ^^^ ------
14 help: change the type of the numeric literal from `u8` to `u16`
15    |
16 LL |     foo(1u16);
17    |          ~~~
18
19 error[E0308]: mismatched types
20   --> $DIR/numeric-literal-cast.rs:8:10
21    |
22 LL |     foo1(2f32);
23    |     ---- ^^^^ expected `f64`, found `f32`
24    |     |
25    |     arguments to this function are incorrect
26    |
27 note: function defined here
28   --> $DIR/numeric-literal-cast.rs:2:4
29    |
30 LL | fn foo1(_: f64) {}
31    |    ^^^^ ------
32 help: change the type of the numeric literal from `f32` to `f64`
33    |
34 LL |     foo1(2f64);
35    |           ~~~
36
37 error[E0308]: mismatched types
38   --> $DIR/numeric-literal-cast.rs:10:10
39    |
40 LL |     foo2(3i16);
41    |     ---- ^^^^ expected `i32`, found `i16`
42    |     |
43    |     arguments to this function are incorrect
44    |
45 note: function defined here
46   --> $DIR/numeric-literal-cast.rs:3:4
47    |
48 LL | fn foo2(_: i32) {}
49    |    ^^^^ ------
50 help: change the type of the numeric literal from `i16` to `i32`
51    |
52 LL |     foo2(3i32);
53    |           ~~~
54
55 error: aborting due to 3 previous errors
56
57 For more information about this error, try `rustc --explain E0308`.