]> git.lizzy.rs Git - rust.git/blob - tests/ui/cast/cast-int-to-char.stderr
Rollup merge of #106896 - Ezrashaw:str-cast-bool-emptyness, r=compiler-errors
[rust.git] / tests / ui / cast / cast-int-to-char.stderr
1 error[E0308]: mismatched types
2   --> $DIR/cast-int-to-char.rs:4:16
3    |
4 LL |     foo::<u32>('0');
5    |     ---------- ^^^ expected `u32`, found `char`
6    |     |
7    |     arguments to this function are incorrect
8    |
9 note: function defined here
10   --> $DIR/cast-int-to-char.rs:1:4
11    |
12 LL | fn foo<T>(_t: T) {}
13    |    ^^^    -----
14 help: you can cast a `char` to a `u32`, since a `char` always occupies 4 bytes
15    |
16 LL |     foo::<u32>('0' as u32);
17    |                    ++++++
18
19 error[E0308]: mismatched types
20   --> $DIR/cast-int-to-char.rs:5:16
21    |
22 LL |     foo::<i32>('0');
23    |     ---------- ^^^ expected `i32`, found `char`
24    |     |
25    |     arguments to this function are incorrect
26    |
27 note: function defined here
28   --> $DIR/cast-int-to-char.rs:1:4
29    |
30 LL | fn foo<T>(_t: T) {}
31    |    ^^^    -----
32 help: you can cast a `char` to an `i32`, since a `char` always occupies 4 bytes
33    |
34 LL |     foo::<i32>('0' as i32);
35    |                    ++++++
36
37 error[E0308]: mismatched types
38   --> $DIR/cast-int-to-char.rs:6:16
39    |
40 LL |     foo::<u64>('0');
41    |     ---------- ^^^ expected `u64`, found `char`
42    |     |
43    |     arguments to this function are incorrect
44    |
45 note: function defined here
46   --> $DIR/cast-int-to-char.rs:1:4
47    |
48 LL | fn foo<T>(_t: T) {}
49    |    ^^^    -----
50 help: you can cast a `char` to a `u64`, since a `char` always occupies 4 bytes
51    |
52 LL |     foo::<u64>('0' as u64);
53    |                    ++++++
54
55 error[E0308]: mismatched types
56   --> $DIR/cast-int-to-char.rs:7:16
57    |
58 LL |     foo::<i64>('0');
59    |     ---------- ^^^ expected `i64`, found `char`
60    |     |
61    |     arguments to this function are incorrect
62    |
63 note: function defined here
64   --> $DIR/cast-int-to-char.rs:1:4
65    |
66 LL | fn foo<T>(_t: T) {}
67    |    ^^^    -----
68 help: you can cast a `char` to an `i64`, since a `char` always occupies 4 bytes
69    |
70 LL |     foo::<i64>('0' as i64);
71    |                    ++++++
72
73 error[E0308]: mismatched types
74   --> $DIR/cast-int-to-char.rs:8:17
75    |
76 LL |     foo::<char>(0u32);
77    |     ----------- ^^^^ expected `char`, found `u32`
78    |     |
79    |     arguments to this function are incorrect
80    |
81 note: function defined here
82   --> $DIR/cast-int-to-char.rs:1:4
83    |
84 LL | fn foo<T>(_t: T) {}
85    |    ^^^    -----
86
87 error: aborting due to 5 previous errors
88
89 For more information about this error, try `rustc --explain E0308`.