一、安装stable版
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
二、安装nightly版
$ rustc --version
$ rustup toolchain install nightly
$ rustup default nightly
info: using existing install for 'nightly-x86_64-apple-darwin'
info: default toolchain set to 'nightly-x86_64-apple-darwin'
nightly-x86_64-apple-darwin unchanged - rustc 1.53.0-nightly (16bf626a3 2021-04-14)
$ rustc --version
rustc 1.53.0-nightly (16bf626a3 2021-04-14)