rust/tests/fail/intrinsics/unchecked_sub2.rs
2022-07-25 10:24:19 -04:00

6 lines
165 B
Rust

#![feature(unchecked_math)]
fn main() {
// MAX overflow
let _val = unsafe { 30000i16.unchecked_sub(-7000) }; //~ ERROR: overflow executing `unchecked_sub`
}