mac安装rust

1.安装

curl https://sh.rustup.rs -sSf | sh

使用brew各种出错,还慢。

2编译

source $HOME/.cargo/env

3.版本查看

rustc --version

4.安装包版本查看

cargo --version

5.第一个例子

名为hello.rs

fn main() {

    println!("Hello World!");
}

6.编译代码

rustc hello.rs

7.运行可执行文件

./hello

原文地址:https://www.cnblogs.com/c-x-a/p/11959149.html