rust/tests/ui/intrinsics/unchecked_math_unsafe.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
398 B
Rust
Raw Normal View History

// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
2019-06-03 14:30:25 -05:00
#![feature(core_intrinsics)]
fn main() {
let (x, y) = (1u32, 2u32);
let add = std::intrinsics::unchecked_add(x, y); //~ ERROR call to unsafe function
let sub = std::intrinsics::unchecked_sub(x, y); //~ ERROR call to unsafe function
let mul = std::intrinsics::unchecked_mul(x, y); //~ ERROR call to unsafe function
}