rust/tests/ui/precondition-checks/assert_unchecked.rs

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

10 lines
286 B
Rust
Raw Normal View History

2024-10-07 19:34:25 -04:00
//@ run-fail
//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
//@ error-pattern: unsafe precondition(s) violated: hint::assert_unchecked must never be called when the condition is false
fn main() {
unsafe {
std::hint::assert_unchecked(false);
}
}