]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/type-overflow.stderr
Rollup merge of #69055 - GuillaumeGomez:clean-up-e0307, r=Dylan-DPC
[rust.git] / src / test / ui / lint / type-overflow.stderr
1 warning: literal out of range for `i8`
2   --> $DIR/type-overflow.rs:5:17
3    |
4 LL |     let error = 255i8;
5    |                 ^^^^^
6    |
7 note: the lint level is defined here
8   --> $DIR/type-overflow.rs:2:9
9    |
10 LL | #![warn(overflowing_literals)]
11    |         ^^^^^^^^^^^^^^^^^^^^
12
13 warning: literal out of range for i8
14   --> $DIR/type-overflow.rs:10:16
15    |
16 LL |     let fail = 0b1000_0001i8;
17    |                ^^^^^^^^^^^^^ help: consider using `u8` instead: `0b1000_0001u8`
18    |
19    = note: the literal `0b1000_0001i8` (decimal `129`) does not fit into an `i8` and will become `-127i8`
20
21 warning: literal out of range for i64
22   --> $DIR/type-overflow.rs:12:16
23    |
24 LL |     let fail = 0x8000_0000_0000_0000i64;
25    |                ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `u64` instead: `0x8000_0000_0000_0000u64`
26    |
27    = note: the literal `0x8000_0000_0000_0000i64` (decimal `9223372036854775808`) does not fit into an `i64` and will become `-9223372036854775808i64`
28
29 warning: literal out of range for u32
30   --> $DIR/type-overflow.rs:14:16
31    |
32 LL |     let fail = 0x1_FFFF_FFFFu32;
33    |                ^^^^^^^^^^^^^^^^ help: consider using `u64` instead: `0x1_FFFF_FFFFu64`
34    |
35    = note: the literal `0x1_FFFF_FFFFu32` (decimal `8589934591`) does not fit into an `u32` and will become `4294967295u32`
36
37 warning: literal out of range for i128
38   --> $DIR/type-overflow.rs:16:22
39    |
40 LL |     let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000;
41    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42    |
43    = note: the literal `0x8000_0000_0000_0000_0000_0000_0000_0000` (decimal `170141183460469231731687303715884105728`) does not fit into an `i128` and will become `-170141183460469231731687303715884105728i128`
44    = help: consider using `u128` instead
45
46 warning: literal out of range for i32
47   --> $DIR/type-overflow.rs:19:16
48    |
49 LL |     let fail = 0x8FFF_FFFF_FFFF_FFFE;
50    |                ^^^^^^^^^^^^^^^^^^^^^
51    |
52    = note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into an `i32` and will become `-2i32`
53    = help: consider using `i128` instead
54
55 warning: literal out of range for i8
56   --> $DIR/type-overflow.rs:21:17
57    |
58 LL |     let fail = -0b1111_1111i8;
59    |                 ^^^^^^^^^^^^^ help: consider using `i16` instead: `0b1111_1111i16`
60    |
61    = note: the literal `0b1111_1111i8` (decimal `255`) does not fit into an `i8` and will become `-1i8`
62