fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.2 KiB47 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
30help: change the type of the numeric literal from `i8` to `i32`
31   |
32LL |     let c: i32 = 1i32;
33   |                  ^^^^
34
35error[E0308]: mismatched types
36  --> $DIR/const-scope.rs:11:17
37   |
38LL |     let d: i8 = c;
39   |                 ^ expected i8, found i32
40help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit
41   |
42LL |     let d: i8 = c.try_into().unwrap();
43   |                 ^^^^^^^^^^^^^^^^^^^^^
44
45error: aborting due to 6 previous errors
46
47For more information about this error, try `rustc --explain E0308`.