Skip to content

Mark as disabled on WASM #2

@lex-gsynergy

Description

@lex-gsynergy

As a small feature request, can the crate be annotated in some way to trigger a compile error on Wasm? I don't know if it's the best way, but an option I see from this Stack Overflow post is to call compile_error!() if the configuration target is Wasm. Something like:

#[cfg(target_family="wasm")]
compile_error!("The `interned-string` crate cannot run on WebAssembly due to needing multiple threads.");

The reason I ask is that I spent over an hour attempting to integrate interned-string into a Wasm project before realizing it would be hopeless, and the error message is very cryptic--it has to do with reentering a mutex.

I understand the limitation and can see reasons not to want to bother making it work on Wasm. It is a pity, though, to get a successful compile and then get a bizarre error message at run time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions