]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/uninhabited-enum.rs
Rollup merge of #100184 - Kixunil:stabilize_ptr_const_cast, r=m-ou-se
[rust.git] / src / test / mir-opt / uninhabited-enum.rs
1 #![feature(never_type)]
2
3 pub enum Void {}
4
5 // EMIT_MIR uninhabited_enum.process_never.SimplifyLocals.after.mir
6 #[no_mangle]
7 pub fn process_never(input: *const !) {
8    let _input = unsafe { &*input };
9 }
10
11 // EMIT_MIR uninhabited_enum.process_void.SimplifyLocals.after.mir
12 #[no_mangle]
13 pub fn process_void(input: *const Void) {
14    let _input = unsafe { &*input };
15    // In the future, this should end with `unreachable`, but we currently only do
16    // unreachability analysis for `!`.
17 }
18
19 fn main() {}