about summary refs log tree commit diff
path: root/tests/ui/precondition-checks/assert_unchecked.rs
blob: 22b2b41455021136adfe76b9556375b07c576343 (plain)
1
2
3
4
5
6
7
8
9
//@ 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);
    }
}