]> git.proxmox.com Git - rustc.git/blame - src/test/ui/lint/type-overflow.stderr
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / lint / type-overflow.stderr
CommitLineData
48663c56 1warning: literal out of range for `i8`
9fa01778 2 --> $DIR/type-overflow.rs:5:17
0531ce1d 3 |
532ac7d7 4LL | let error = 255i8;
0531ce1d
XL
5 | ^^^^^
6 |
74b04a01 7note: the lint level is defined here
9fa01778
XL
8 --> $DIR/type-overflow.rs:2:9
9 |
10LL | #![warn(overflowing_literals)]
11 | ^^^^^^^^^^^^^^^^^^^^
ba9703b0 12 = note: the literal `255i8` does not fit into the type `i8` whose range is `-128..=127`
6a06907d 13 = help: consider using the type `u8` instead
0531ce1d 14
6a06907d 15warning: literal out of range for `i8`
9fa01778 16 --> $DIR/type-overflow.rs:10:16
0531ce1d 17 |
532ac7d7 18LL | let fail = 0b1000_0001i8;
6a06907d 19 | ^^^^^^^^^^^^^ help: consider using the type `u8` instead: `0b1000_0001u8`
0531ce1d 20 |
ba9703b0 21 = note: the literal `0b1000_0001i8` (decimal `129`) does not fit into the type `i8` and will become `-127i8`
0531ce1d 22
6a06907d 23warning: literal out of range for `i64`
9fa01778 24 --> $DIR/type-overflow.rs:12:16
0531ce1d 25 |
532ac7d7 26LL | let fail = 0x8000_0000_0000_0000i64;
6a06907d 27 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the type `u64` instead: `0x8000_0000_0000_0000u64`
0531ce1d 28 |
ba9703b0 29 = note: the literal `0x8000_0000_0000_0000i64` (decimal `9223372036854775808`) does not fit into the type `i64` and will become `-9223372036854775808i64`
0531ce1d 30
6a06907d 31warning: literal out of range for `u32`
9fa01778 32 --> $DIR/type-overflow.rs:14:16
0531ce1d 33 |
532ac7d7 34LL | let fail = 0x1_FFFF_FFFFu32;
6a06907d 35 | ^^^^^^^^^^^^^^^^ help: consider using the type `u64` instead: `0x1_FFFF_FFFFu64`
0531ce1d 36 |
ba9703b0 37 = note: the literal `0x1_FFFF_FFFFu32` (decimal `8589934591`) does not fit into the type `u32` and will become `4294967295u32`
0531ce1d 38
6a06907d 39warning: literal out of range for `i128`
9fa01778 40 --> $DIR/type-overflow.rs:16:22
0531ce1d
XL
41 |
42LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000;
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44 |
ba9703b0 45 = note: the literal `0x8000_0000_0000_0000_0000_0000_0000_0000` (decimal `170141183460469231731687303715884105728`) does not fit into the type `i128` and will become `-170141183460469231731687303715884105728i128`
6a06907d 46 = help: consider using the type `u128` instead
0531ce1d 47
6a06907d 48warning: literal out of range for `i32`
9fa01778 49 --> $DIR/type-overflow.rs:19:16
0531ce1d 50 |
532ac7d7 51LL | let fail = 0x8FFF_FFFF_FFFF_FFFE;
0531ce1d
XL
52 | ^^^^^^^^^^^^^^^^^^^^^
53 |
ba9703b0 54 = note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into the type `i32` and will become `-2i32`
6a06907d 55 = help: consider using the type `i128` instead
0531ce1d 56
6a06907d 57warning: literal out of range for `i8`
9fa01778 58 --> $DIR/type-overflow.rs:21:17
0531ce1d 59 |
532ac7d7 60LL | let fail = -0b1111_1111i8;
6a06907d 61 | ^^^^^^^^^^^^^ help: consider using the type `i16` instead: `0b1111_1111i16`
0531ce1d 62 |
6a06907d
XL
63 = note: the literal `0b1111_1111i8` (decimal `255`) does not fit into the type `i8`
64 = note: and the value `-0b1111_1111i8` will become `1i8`
ba9703b0
XL
65
66warning: 7 warnings emitted
0531ce1d 67