rust/tests/fail/intrinsics/unchecked_mul1.rs

6 lines
164 B
Rust
Raw Normal View History

2022-07-24 13:28:45 -05:00
#![feature(unchecked_math)]
fn main() {
// MAX overflow
2022-07-24 13:28:45 -05:00
let _val = unsafe { 300u16.unchecked_mul(250u16) }; //~ ERROR: overflow executing `unchecked_mul`
}