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
Since the environments of the web and native platforms are so different, there are times when you need to use these attributes to include and exclude parts of the code depending on whether it's targeting web or not.
By default, Rust-analyzer runs in native mode. To make it run in webassembly mode, add .cargo/config.toml file with this content:
[build]
# Uncomment the line below to switch Rust-analyzer to perform# type checking and linting in webassembly mode, for the web target.# You might have to restart Rust-analyzer for this change to take effect.target = "wasm32-unknown-unknown"rustflags = ["-C", "target-feature=+atomics,+bulk-memory,+mutable-globals"]
[unstable]
build-std = ['std', 'panic_abort']
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There might be various Rust codes with these attribute above:
Since the environments of the web and native platforms are so different, there are times when you need to use these attributes to include and exclude parts of the code depending on whether it's targeting web or not.
By default, Rust-analyzer runs in native mode. To make it run in webassembly mode, add
.cargo/config.toml
file with this content:Beta Was this translation helpful? Give feedback.
All reactions