15
15
#![ unstable( feature = "panic_unwind" , issue = "32837" ) ]
16
16
#![ doc( issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/" ) ]
17
17
#![ feature( cfg_emscripten_wasm_eh) ]
18
+ #![ feature( cfg_select) ]
18
19
#![ feature( core_intrinsics) ]
19
20
#![ feature( lang_items) ]
20
21
#![ feature( panic_unwind) ]
@@ -33,38 +34,44 @@ use alloc::boxed::Box;
33
34
use core:: any:: Any ;
34
35
use core:: panic:: PanicPayload ;
35
36
36
- cfg_if :: cfg_if ! {
37
- if # [ cfg ( all( target_os = "emscripten" , not( emscripten_wasm_eh) ) ) ] {
37
+ cfg_select ! {
38
+ all( target_os = "emscripten" , not( emscripten_wasm_eh) ) => {
38
39
#[ path = "emcc.rs" ]
39
40
mod imp;
40
- } else if #[ cfg( target_os = "hermit" ) ] {
41
+ }
42
+ target_os = "hermit" => {
41
43
#[ path = "hermit.rs" ]
42
44
mod imp;
43
- } else if #[ cfg( target_os = "l4re" ) ] {
45
+ }
46
+ target_os = "l4re" => {
44
47
// L4Re is unix family but does not yet support unwinding.
45
48
#[ path = "dummy.rs" ]
46
49
mod imp;
47
- } else if #[ cfg( any(
50
+ }
51
+ any(
48
52
all( target_family = "windows" , target_env = "gnu" ) ,
49
53
target_os = "psp" ,
50
54
target_os = "xous" ,
51
55
target_os = "solid_asp3" ,
52
56
all( target_family = "unix" , not( any( target_os = "espidf" , target_os = "nuttx" ) ) ) ,
53
57
all( target_vendor = "fortanix" , target_env = "sgx" ) ,
54
58
target_family = "wasm" ,
55
- ) ) ] {
59
+ ) => {
56
60
#[ path = "gcc.rs" ]
57
61
mod imp;
58
- } else if #[ cfg( miri) ] {
62
+ }
63
+ miri => {
59
64
// Use the Miri runtime on Windows as miri doesn't support funclet based unwinding,
60
65
// only landingpad based unwinding. Also use the Miri runtime on unsupported platforms.
61
66
#[ path = "miri.rs" ]
62
67
mod imp;
63
- } else if #[ cfg( all( target_env = "msvc" , not( target_arch = "arm" ) ) ) ] {
68
+ }
69
+ all( target_env = "msvc" , not( target_arch = "arm" ) ) => {
64
70
// LLVM does not support unwinding on 32 bit ARM msvc (thumbv7a-pc-windows-msvc)
65
71
#[ path = "seh.rs" ]
66
72
mod imp;
67
- } else {
73
+ }
74
+ _ => {
68
75
// Targets that don't support unwinding.
69
76
// - os=none ("bare metal" targets)
70
77
// - os=uefi
0 commit comments