]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/uninhabited_enum.rs
Rollup merge of #103236 - tspiteri:redoc-int-adc-sbb, r=m-ou-se
[rust.git] / tests / mir-opt / uninhabited_enum.rs
1 #![feature(never_type)]
2
3 pub enum Void {}
4
5 // EMIT_MIR uninhabited_enum.process_never.SimplifyLocals-final.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-final.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() {}