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