about summary refs log tree commit diff
path: root/tests/ui/precondition-checks/alignment.rs
blob: 92400528fa07fc453c82af32ef10570ef666f185 (plain)
1
2
3
4
5
6
7
8
9
10
11
//@ run-fail
//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
//@ error-pattern: unsafe precondition(s) violated: Alignment::new_unchecked requires

#![feature(ptr_alignment_type)]

fn main() {
    unsafe {
        std::ptr::Alignment::new_unchecked(0);
    }
}