fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

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