fork/rust

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

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

master
1.7 KiB67 linesraw
1error[E0308]: mismatched types
2  --> $DIR/const-scope.rs:1:16
3   |
4LL | const C: i32 = 1i8;
5   |                ^^^ expected `i32`, found `i8`
6   |
7help: change the type of the numeric literal from `i8` to `i32`
8   |
9LL | const C: i32 = 1i32;
10   |                 ~~~
11
12error[E0308]: mismatched types
13  --> $DIR/const-scope.rs:2:15
14   |
15LL | const D: i8 = C;
16   |               ^ expected `i8`, found `i32`
17
18error[E0308]: mismatched types
19  --> $DIR/const-scope.rs:5:18
20   |
21LL |     let c: i32 = 1i8;
22   |            ---   ^^^ expected `i32`, found `i8`
23   |            |
24   |            expected due to this
25   |
26help: change the type of the numeric literal from `i8` to `i32`
27   |
28LL |     let c: i32 = 1i32;
29   |                   ~~~
30
31error[E0308]: mismatched types
32  --> $DIR/const-scope.rs:6:17
33   |
34LL |     let d: i8 = c;
35   |            --   ^ expected `i8`, found `i32`
36   |            |
37   |            expected due to this
38
39error[E0308]: mismatched types
40  --> $DIR/const-scope.rs:10:18
41   |
42LL |     let c: i32 = 1i8;
43   |            ---   ^^^ expected `i32`, found `i8`
44   |            |
45   |            expected due to this
46   |
47help: change the type of the numeric literal from `i8` to `i32`
48   |
49LL |     let c: i32 = 1i32;
50   |                   ~~~
51
52error[E0308]: mismatched types
53  --> $DIR/const-scope.rs:11:17
54   |
55LL |     let d: i8 = c;
56   |            --   ^ expected `i8`, found `i32`
57   |            |
58   |            expected due to this
59   |
60help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
61   |
62LL |     let d: i8 = c.try_into().unwrap();
63   |                  ++++++++++++++++++++
64
65error: aborting due to 6 previous errors
66
67For more information about this error, try `rustc --explain E0308`.