]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/uninhabited-enum.rs
Rollup merge of #66574 - GuillaumeGomez:update-tidy-err-code-check, r=Mark-Simulacrum
[rust.git] / src / test / mir-opt / uninhabited-enum.rs
1 pub enum Void {}
2
3 #[no_mangle]
4 pub fn process_never(input: *const !) {
5    let _input = unsafe { &*input };
6 }
7
8 #[no_mangle]
9 pub fn process_void(input: *const Void) {
10    let _input = unsafe { &*input };
11    // In the future, this should end with `unreachable`, but we currently only do
12    // unreachability analysis for `!`.
13 }
14
15 fn main() {}
16
17 // END RUST SOURCE
18 //
19 // START rustc.process_never.SimplifyLocals.after.mir
20 // bb0: {
21 //     StorageLive(_2);
22 //     _2 = &(*_1);
23 //     StorageDead(_2);
24 //     unreachable;
25 // }
26 // END rustc.process_never.SimplifyLocals.after.mir
27 //
28 // START rustc.process_void.SimplifyLocals.after.mir
29 // bb0: {
30 //     StorageLive(_2);
31 //     _2 = &(*_1);
32 //     StorageDead(_2);
33 //     return;
34 // }
35 // END rustc.process_void.SimplifyLocals.after.mir