rust/tests/compile-fail/assume.rs

11 lines
232 B
Rust
Raw Normal View History

2016-09-13 13:08:57 +02:00
#![feature(core_intrinsics)]
fn main() {
let x = 5;
unsafe {
std::intrinsics::assume(x < 10);
std::intrinsics::assume(x > 1);
2018-10-19 11:50:17 +02:00
std::intrinsics::assume(x > 42); //~ `assume` argument was false
2016-09-13 13:08:57 +02:00
}
}