Post

Mac安装rust环境

参考:

1、Mac安装rust环境

1
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

选择安装方式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: aarch64-apple-darwin
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation

我选择1

安装完成后配置环境

1
2
3
4
echo $SHELL
. "$HOME/.cargo/env"
rustc --version
cargo --version

卸载:

1
2
3
rustup self uninstall
rm -rf ~/.cargo
rm -rf ~/.rustup

vs code安装插件 rust-analyzerNative Debug

安装launch环境 安装插件:CodeLLDB 建立文件 .vscode/launch.json

资料: https://www.runoob.com/rust/rust-basic-syntax.html 通过例子学 Rust 中文版

This post is licensed under CC BY 4.0 by the author.