rust/tests/compile-fail/unchecked_div1.rs

6 lines
185 B
Rust
Raw Normal View History

2020-02-06 04:24:38 -06:00
#![feature(core_intrinsics)]
fn main() {
// MIN/-1 cannot be represented
unsafe { std::intrinsics::unchecked_div(i16::MIN, -1); } //~ ERROR Overflow executing `unchecked_div`
2020-02-06 04:24:38 -06:00
}