Closed
Description
Test case:
#![feature(i128_type)]
fn main() {
-0x8000_0000_0000_0000i64; // ok
-0x8000_0000_0000_0000_0000_0000_0000_0000i128; // Error: attempt to negate with overflow
}
Gives error:
error[E0080]: constant evaluation error
--> foo.rs:4:5
|
4 | -0x8000_0000_0000_0000_0000_0000_0000_0000i128; // Error: attempt to negate with overflow
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to negate with overflow
error: aborting due to previous error
It should compiles fine and the constant should produce the same value as i128::MIN
.
For comparison the minimum i64 compiles fine with no warnings.
$ rustc -vV
rustc 1.16.0-nightly (47c8d9fdc 2017-01-08)
binary: rustc
commit-hash: 47c8d9fdcf2e6502cf4ca7d7f059fdc1a2810afa
commit-date: 2017-01-08
host: x86_64-apple-darwin
release: 1.16.0-nightly
LLVM version: 3.9
Metadata
Metadata
Assignees
Labels
No labels