rust/tests/compile-fail/intrinsics/assume.rs

11 lines
243 B
Rust
Raw Normal View History

2016-09-13 06:08:57 -05:00
#![feature(core_intrinsics)]
fn main() {
let x = 5;
unsafe {
std::intrinsics::assume(x < 10);
std::intrinsics::assume(x > 1);
2019-08-05 03:45:48 -05:00
std::intrinsics::assume(x > 42); //~ `assume` intrinsic called with `false`
2016-09-13 06:08:57 -05:00
}
}