std: fix wasm builds · model-checking/verify-rust-std@5ae0378 (original) (raw)

Original file line number Diff line number Diff line change
@@ -83,8 +83,18 @@ mod guard {
83 83 pub(super) use windows::enable;
84 84 } else if #[cfg(any(
85 85 all(target_family = "wasm", target_feature = "atomics"),
86 - target_os = "hermit",
87 86 ))] {
87 +pub(super) fn enable() {
88 +// FIXME: Right now there is no concept of "thread exit", but
89 +// this is likely going to show up at some point in the form of
90 +// an exported symbol that the wasm runtime is going to be
91 +// expected to call. For now we just leak everything, but if
92 +// such a function starts to exist it will probably need to
93 +// iterate the destructor list with this function:
94 + #[allow(unused)]
95 +use super::destructors::run;
96 +}
97 +} else if #[cfg(target_os = "hermit")] {
88 98 pub(super) fn enable() {}
89 99 } else if #[cfg(target_os = "solid_asp3")] {
90 100 mod solid;
@@ -105,7 +115,11 @@ mod guard {
105 115 pub(crate) mod key {
106 116 cfg_if::cfg_if! {
107 117 if #[cfg(any(
108 - all(not(target_vendor = "apple"), target_family = "unix"),
118 + all(
119 + not(target_vendor = "apple"),
120 + not(target_family = "wasm"),
121 + target_family = "unix",
122 +),
109 123 target_os = "teeos",
110 124 ))] {
111 125 mod racy;