# The wasm32 branch of libstd never works

**URL:** <https://internals.rust-lang.org/t/the-wasm32-branch-of-libstd-never-works/8365>\
**Category:** compiler\
**Created:** [September 6, 2018, 3:18am UTC](https://internals.rust-lang.org/t/the-wasm32-branch-of-libstd-never-works/8365 "2018-09-06T03:18:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maojingkai](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/maojingkai/32/1397_2.png) [@maojingkai](https://internals.rust-lang.org/u/maojingkai)\
**Post date:** [September 6, 2018, 3:18am UTC](https://internals.rust-lang.org/t/the-wasm32-branch-of-libstd-never-works/8365/1 "2018-09-06T03:18:55Z")

</div>

Hi,

I’m trying to compile program with `cargo build --target=wasm32-unknown-emscripten --all`. And the `UnsafeCell` fallback of `RwLock` and `Mutex` in the wasm32 implementation of libstd helps a lot in my scenario.

But it seems that the wasm32 branch never works due to [https://github.com/rust-lang/rust/blob/8b7f164eab538025a29488e2e47ae7b4bbee2ad9/src/libstd/sys/mod.rs#L35](https://github.com/rust-lang/rust/blob/8b7f164eab538025a29488e2e47ae7b4bbee2ad9/src/libstd/sys/mod.rs#L35). Is this the desired behavior?

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:30am UTC](https://internals.rust-lang.org/t/the-wasm32-branch-of-libstd-never-works/8365/2 "2019-03-25T08:30:50Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
