]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr
Rollup merge of #103204 - jyn514:autolabels, r=Mark-Simulacrum
[rust.git] / src / test / ui / consts / const-eval / const-eval-overflow-4b.stderr
1 error[E0308]: mismatched types
2   --> $DIR/const-eval-overflow-4b.rs:9:30
3    |
4 LL |     : [u32; (i8::MAX as i8 + 1u8) as usize]
5    |                              ^^^ expected `i8`, found `u8`
6
7 error[E0277]: cannot add `u8` to `i8` in const contexts
8   --> $DIR/const-eval-overflow-4b.rs:9:28
9    |
10 LL |     : [u32; (i8::MAX as i8 + 1u8) as usize]
11    |                            ^ no implementation for `i8 + u8`
12    |
13    = help: the trait `~const Add<u8>` is not implemented for `i8`
14    = help: the following other types implement trait `Add<Rhs>`:
15              <&'a f32 as Add<f32>>
16              <&'a f64 as Add<f64>>
17              <&'a i128 as Add<i128>>
18              <&'a i16 as Add<i16>>
19              <&'a i32 as Add<i32>>
20              <&'a i64 as Add<i64>>
21              <&'a i8 as Add<i8>>
22              <&'a isize as Add<isize>>
23            and 48 others
24
25 error[E0604]: only `u8` can be cast as `char`, not `i8`
26   --> $DIR/const-eval-overflow-4b.rs:22:13
27    |
28 LL |     : [u32; 5i8 as char as usize]
29    |             ^^^^^^^^^^^ invalid cast
30    |
31 help: try casting from `u8` instead
32   --> $DIR/const-eval-overflow-4b.rs:22:13
33    |
34 LL |     : [u32; 5i8 as char as usize]
35    |             ^^^^^^^^^^^
36
37 error: aborting due to 3 previous errors
38
39 Some errors have detailed explanations: E0277, E0308, E0604.
40 For more information about an error, try `rustc --explain E0277`.