81b8df4323
We spent a lot of text in the README describing how to use the nightly Rust compiler with this project. Let's instead add a `rust-toolchain.toml` file so that the nightly compiler is used automatically, and let's redraft the README in that light. With this revision, we'll add a section on installing dependencies in which we'll describe how to ensure that the nightly compiler is installed and up to date and how to install `mdbook`. When describing how to clone the project, we'll suggest that people clone the URL ending in `.git`. This is what GitHub recommends, and it removes a level of redirection which sometimes matters. For people who want to download a ZIP file rather than using `git`, we'll provide a direct link rather than simply referencing the GitHub page. When describing how to build the book, we'll suggesting passing `--open` to `mdbook`, as this is usually what people will want, and it will save a step. Along with these changes, we include some general copyediting. |
||
---|---|---|
.github/workflows | ||
src | ||
style-check | ||
theme | ||
.gitattributes | ||
.gitignore | ||
CONTRIBUTING.md | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md | ||
STYLE.md | ||
book.toml | ||
reference.md | ||
rust-toolchain.toml | ||
triagebot.toml |
README.md
The Rust Language Reference
This document is the primary reference for the Rust programming language.
This document is not normative. It may include details that are specific
to rustc
itself, and should not be taken as a specification for the
Rust language. We intend to produce such a document someday, but this is
what we have for now.
Dependencies
- Nightly Rust
- mdbook
Installing dependencies
First, ensure that you have a recent copy of the nightly Rust compiler installed, as this is needed in order to run the tests:
rustup toolchain install nightly
Now, ensure you have mdbook
installed, as this is needed in order to
build the Reference:
cargo install --locked mdbook
Building
To build the Reference, first clone the project:
git clone https://github.com/rust-lang/reference.git
(Alternatively, if you don't want to use git
, download a ZIP file
of the project, extract it using your preferred tool, and rename the
top-level directory to reference
.)
Now change your current directory to the working directory:
cd reference
To test all of the code examples in the Reference, run:
mdbook test
To build the Reference locally (in build/
) and open it in a web
browser, run:
mdbook build --open