Closed ctaggart closed 3 years ago
Hi @dtolnay 👋🏻 ,
I am trying to build https://github.com/Azure/azure-sdk-for-rust/pull/228 for wasm, but I ran into a problem where wasm should not have the Send markers. This does not work, but what I roughly want to do is:
Send
cfg_if::cfg_if! { if cfg(target_arch = "wasm32") { #[async_trait(?Send)] } else { #[async_trait] } }
Any suggestions on how to solve this predicament?
I think cfg_attr would work. Something like the following:
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait)]
Hi @dtolnay 👋🏻 ,
I am trying to build https://github.com/Azure/azure-sdk-for-rust/pull/228 for wasm, but I ran into a problem where wasm should not have the
Send
markers. This does not work, but what I roughly want to do is:Any suggestions on how to solve this predicament?