@@ -82,53 +82,18 @@ pub(crate) mod destructors {
8282/// and the [runtime cleanup](crate::rt::thread_cleanup) function. Calling `enable`
8383/// should ensure that these functions are called at the right times.
8484pub ( crate ) mod guard {
85- cfg_select ! {
86- all( target_thread_local, target_vendor = "apple" ) => {
87- mod apple;
88- pub ( crate ) use apple:: enable;
89- }
90- target_os = "windows" => {
91- mod windows;
92- pub ( crate ) use windows:: enable;
93- }
94- any(
95- all( target_family = "wasm" , not(
96- all( target_os = "wasi" , target_env = "p1" , target_feature = "atomics" )
97- ) ) ,
98- target_os = "uefi" ,
99- target_os = "zkvm" ,
100- target_os = "trusty" ,
101- ) => {
102- pub ( crate ) fn enable( ) {
103- // FIXME: Right now there is no concept of "thread exit" on
104- // wasm, but this is likely going to show up at some point in
105- // the form of an exported symbol that the wasm runtime is going
106- // to be expected to call. For now we just leak everything, but
107- // if such a function starts to exist it will probably need to
108- // iterate the destructor list with these functions:
109- #[ cfg( all( target_family = "wasm" , target_feature = "atomics" ) ) ]
110- #[ allow( unused) ]
111- use super :: destructors:: run;
112- #[ allow( unused) ]
113- use crate :: rt:: thread_cleanup;
114- }
115- }
116- any(
117- target_os = "hermit" ,
118- target_os = "xous" ,
119- ) => {
120- // `std` is the only runtime, so it just calls the destructor functions
121- // itself when the time comes.
122- pub ( crate ) fn enable( ) { }
123- }
124- target_os = "solid_asp3" => {
125- mod solid;
126- pub ( crate ) use solid:: enable;
127- }
128- _ => {
129- mod key;
130- pub ( crate ) use key:: enable;
131- }
85+ pub ( crate ) fn enable ( ) {
86+ // FIXME: Right now there is no concept of "thread exit" on
87+ // wasm, but this is likely going to show up at some point in
88+ // the form of an exported symbol that the wasm runtime is going
89+ // to be expected to call. For now we just leak everything, but
90+ // if such a function starts to exist it will probably need to
91+ // iterate the destructor list with these functions:
92+ #[ cfg( all( target_family = "wasm" , target_feature = "atomics" ) ) ]
93+ #[ allow( unused) ]
94+ use super :: destructors:: run;
95+ #[ allow( unused) ]
96+ use crate :: rt:: thread_cleanup;
13297 }
13398}
13499
0 commit comments