Rust Essentials(Second Edition)
上QQ阅读APP看书,第一时间看更新

rustc--the Rust compiler

The Rust installation directory containing rustc can be found on your machine in the following folder (unless you have chosen a different installation folder):

  • On Windows at C:\Users\username\.cargo\bin
  • On Linux or OS X in /home/username/.cargo/bin

rustc and the other binaries can be run from any command-line window. The rustc command has the following format:

rustc [options] input

The options are one-letter directives for the compiler after a dash, like -g or -W, or words prefixed by a double dash, like - -test or - -version. All options with some explanation are shown when invoking rustc -h. In the next section, we verify our installation by compiling and running our first Rust program.

To view a local copy of the Rust documentation as a website, type rustup doc into a terminal.