首先開始安裝rust,我是在linux環境下安裝的
執行命令
curl https://sh.rustup.rs -sSf | sh
然後重新登陸下linux,下列命令生效即表示rust安裝成功
rustup -h
然後使用rustup可能會報 以下錯誤
error: no default toolchain configured
然後使用以下命令配置默認工具鏈
rustup default stable
獲取rust源碼
rustup component add rust-src
racer
racer是一個由rust的愛好者提供的rust自動補全和語法分析工具,被用來提供基本的補全功能和定義跳轉功能。其本身完全由rust寫成,補全功能已經比較完善了。
使用cargo安裝racer
cargo install racer
然後可能會報個錯
error[E0554]: `#![feature]` may not be used on the stable release channel
分析可能是toolchain 只有stable導致 ;解決方案如下
rustup update nightly
參考文檔地址