41 lines
1.7 KiB
Plaintext
41 lines
1.7 KiB
Plaintext
error: literal out of range for `i8`
|
|
--> $DIR/no-inline-literals-out-of-range.rs:2:24
|
|
|
|
|
LL | format_args!("{}", 0x8f_i8); // issue #115423
|
|
| ^^^^^^^
|
|
|
|
|
= note: the literal `0x8f_i8` (decimal `143`) does not fit into the type `i8` and will become `-113i8`
|
|
= note: `#[deny(overflowing_literals)]` on by default
|
|
help: consider using the type `u8` instead
|
|
|
|
|
LL | format_args!("{}", 0x8f_u8); // issue #115423
|
|
| ~~~~~~~
|
|
help: to use as a negative number (decimal `-113`), consider using the type `u8` for the literal and cast it to `i8`
|
|
|
|
|
LL | format_args!("{}", 0x8f_u8 as i8); // issue #115423
|
|
| ~~~~~~~~~~~~~
|
|
|
|
error: literal out of range for `u8`
|
|
--> $DIR/no-inline-literals-out-of-range.rs:4:24
|
|
|
|
|
LL | format_args!("{}", 0xffff_ffff_u8); // issue #116633
|
|
| ^^^^^^^^^^^^^^ help: consider using the type `u32` instead: `0xffff_ffff_u32`
|
|
|
|
|
= note: the literal `0xffff_ffff_u8` (decimal `4294967295`) does not fit into the type `u8` and will become `255u8`
|
|
|
|
error: literal out of range for `i32`
|
|
--> $DIR/no-inline-literals-out-of-range.rs:6:24
|
|
|
|
|
LL | format_args!("{}", 0xffff_ffff); // treat unsuffixed literals as i32
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= note: the literal `0xffff_ffff` (decimal `4294967295`) does not fit into the type `i32` and will become `-1i32`
|
|
= help: consider using the type `u32` instead
|
|
help: to use as a negative number (decimal `-1`), consider using the type `u32` for the literal and cast it to `i32`
|
|
|
|
|
LL | format_args!("{}", 0xffff_ffffu32 as i32); // treat unsuffixed literals as i32
|
|
| ~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
error: aborting due to 3 previous errors
|
|
|