]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/uninhabited-enum.rs
Update upstream source from tag 'upstream/1.49.0_beta.4+dfsg1'
[rustc.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() {}