安装RLS参考: rustup self update
rustup update nightly
rustup component add rls --toolchain nightly
rustup component add rust-analysis --toolchain nightly
rustup component add rust-src --toolchain nightly
rustup component add rust-src --toolchain stable
添加环境变量
set RUST_SRC_PATH=%USERPROFILE%.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\src\rust\src
使用Cargo包管理器安装
cargo install racer
cargo install rustfmt
cargo install rustsym
WASM编译: 安装
rustup target add wasm32-unknown-emscripten stable
编译
cargo build --target=wasm32-unknown-emscripten
或 完整命令
rustup run stable-x86_64-pc-windows-gnu cargo build --target=wasm32-unknown-emscripten
Debug环境配置参考:
a. 安装gdb64 追加如下python脚本到D:\Program Files\gdb-7.9.1-tdm64-2\gdb64\bin\gdbinit文件内。 python
print "---- Loading Rust pretty-printers ----"
from os.path import expanduser
sys.path.insert(0, expanduser("~") + "/.rustup/toolchains/stable-x86_64-pc-windows-gnu/lib/rustlib/etc")
import gdb_rust_pretty_printing
gdb_rust_pretty_printing.register_printers(gdb)