Skip to content

#[cfg(target_thread_local)] is true for WebAssembly targets without atomics enabled #84224

Open
@alexcrichton

Description

@alexcrichton

This compiler-internal and unstable #[cfg] is currently per-target rather than per-target-configuration. This means that thread locals purportedly work on the wasm target when in fact (I think) they only work on the wasm target with the atomics feature enabled.

Ideally the compiler would conditionally define this cfg on wasm (depending on other target features enabled), and then this could enable cleaning up the definitions of thread locals in libstd a bit by relying more on target_thread_local and not special-casing wasm so much.

This came out of a discussion in #83416

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-wasmTarget: WASM (WebAssembly), http://webassembly.org/

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions