about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/never_match_never.rs
blob: 5f2f471bf6098c6d9883a929f8ee29f6da519f03 (plain)
1
2
3
4
5
6
7
8
9
10
// This should fail even without validation
//@compile-flags: -Zmiri-disable-validation

#![feature(never_type)]
#![allow(unreachable_code)]

fn main() {
    let ptr: *const (i32, !) = &0i32 as *const i32 as *const _;
    unsafe { match (*ptr).1 {} } //~ ERROR: entering unreachable code
}