rust/tests/fail/intrinsics/assume.rs
Oli Scherer f9ff70cef9 Rustup
2022-09-07 13:26:35 +00:00

11 lines
240 B
Rust

#![feature(core_intrinsics)]
fn main() {
let x = 5;
unsafe {
std::intrinsics::assume(x < 10);
std::intrinsics::assume(x > 1);
std::intrinsics::assume(x > 42); //~ ERROR: `assume` called with `false`
}
}