官术网_书友最值得收藏!

  • Rust Programming Cookbook
  • Claus Matzinger
  • 199字
  • 2021-06-24 12:27:40

Managing the Rust installation with rustup.rs

To test whether the installation of the Rust toolchain with rustup was successful, the rustc command is available to run in Terminal (or PowerShell on Windows):

$ rustc --version
rustc 1.33.0 (2aa4c46cf 2019-02-28)

Note that you will have a later version when you are running this. It doesn't matter if you stick to the 2018 edition for your code.

Rust requires a native linker to be available on your system. On Linux or Unix systems (such as macOS), Rust calls  cc  for linking, whereas on Windows, the linker of choice is Microsoft Visual Studio's linker, which depends on having Microsoft Visual C++ Build Tools installed. While it's possible to use an open source toolchain on Windows as well, this exercise is left for more advanced users.

Even with the 2018 edition, some useful features are still only available on nightly. To install the nightly edition of rustc, perform these steps:

  1. Run rustup install nightly (use nightly-msvc on Windows if you are not using the GNU toolchain) in a Terminal or PowerShell window.
  2. After the command finishes, the default toolchain (used in cargo) can be switched using rustup default nightly.

主站蜘蛛池模板: 两当县| 天全县| 曲阜市| 齐河县| 龙里县| 桑日县| 深圳市| 汉源县| 宁德市| 嘉定区| 龙井市| 昌黎县| 城市| 临江市| 吴忠市| 丰顺县| 额敏县| 天等县| 温州市| 香格里拉县| 安塞县| 寿宁县| 镇坪县| 文成县| 潜江市| 平果县| 德令哈市| 邻水| 拜城县| 日照市| 芒康县| 绥宁县| 留坝县| 新平| 金坛市| 资兴市| 潼关县| 朔州市| 邹平县| 南川市| 平罗县|