mac安裝rust

1.安裝

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

使用brew各類出錯,還慢。curl

2.版本查看

rustc --version

3.安裝包版本查看

cargo --version

4.第一個例子

名爲hello.rsurl

fn main() {

    println!("Hello World!");
}

5.編譯代碼

rustc hello.rs

6.運行可執行文件

./hello

相關文章
相關標籤/搜索