fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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