// https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/code/package.json
{
"rust-analyzer.cargo.target": "wasm32-unknown-emscripten",
// This is required as `cargo check --all-targets` doesn't seem to work well
// on no-std crates, it generates false "duplicate lang item" errors.
"rust-analyzer.checkOnSave.allTargets": false,
"rust-analyzer.cargo.features": [...]
}
So the target is wasm32, but I'm getting "unresolved import" error in line use core::arch::wasm32;. Any tips? I tried removing this line completely, or trying other Wasm targets like wasm32-wasi, but no luck.
I don't think this is easy to fix, the problem is sadly pretty deep. The main issue is that core::arch module is defined in the standard library as a path inclusion of an stdarch crate:
The relevant stdarch files can be found at ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/stdarch/crates/core_arch/*, I think it's a problem with how rust-analyzer collects source files