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

6 lines
159 B
Rust

#![feature(unchecked_math)]
fn main() {
// MIN overflow
let _val = unsafe { 14u32.unchecked_sub(22) }; //~ ERROR: overflow executing `unchecked_sub`
}