You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A library that has various features like std which I can turn off for no_std, and also by default a rand feature that includes the rand crate.
A WASM binary that targets wasm32-unknown-unknown. This depends on crate 1 with default-features = false (to allow no_std)
The WASM binary replaces the #[panic_handler] and cargo check and cargo build throw no errors.
However, rust-analyzer gives me an error on the panic handler:
found duplicate lang item `panic_impl`
the lang item is first defined in crate `std` (which `test` depends on)
first definition in `std` loaded from /home/jonathan/.rustup/toolchains/1.74.0-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libstd-3354d2cb1f357486.rlib
second definition in the local crate
It might not be what you want, but you can disable the default features when working on the WASM part, which will make std go away.
The other option I can see is to use two VS Code workspaces, one with the library, and one with both, and disable the default features in the workspace settings for the latter.
I have a workspace with 2 crates.
std
which I can turn off for no_std, and also by default arand
feature that includes the rand crate.wasm32-unknown-unknown
. This depends on crate 1 with default-features = false (to allow no_std)The WASM binary replaces the
#[panic_handler]
andcargo check
andcargo build
throw no errors.However, rust-analyzer gives me an error on the panic handler:
Here's the repo: https://github.com/bitcoinjs/tiny-secp256k1/tree/wip/modular (note: the
wip/modular
branch)(I've committed the .cargo folder and .vscode folder)
The text was updated successfully, but these errors were encountered: