When using the 1234i8 syntax in the Display format in formatting macros, the i8 is ignored and treated as a u128.
I tried this code:
fn main() {
println!("{}", 0x8Fi8);
}
I expected to see this happen: Getting an error that 0x8F is out of the bounds for type i8.
Instead, this happened: This function compiles and prints 143.
Meta
rustc --version --verbose:
rustc 1.71.1 (eb26296b5 2023-08-03)
binary: rustc
commit-hash: eb26296b556cef10fb713a38f3d16b9886080f26
commit-date: 2023-08-03
host: x86_64-apple-darwin
release: 1.71.1
LLVM version: 16.0.5
When using the
1234i8syntax in the Display format in formatting macros, thei8is ignored and treated as au128.I tried this code:
I expected to see this happen: Getting an error that
0x8Fis out of the bounds for typei8.Instead, this happened: This function compiles and prints
143.Meta
rustc --version --verbose: