2017-07-15 16:26:00 +00:00
|
|
|
# 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
|
|
|
|
|
|
|
|
- rustc (the Rust compiler).
|
|
|
|
- mdbook (use `cargo install mdbook` to install it).
|
|
|
|
|
|
|
|
## Build steps
|
|
|
|
|
2021-01-17 16:00:02 +00:00
|
|
|
To build the project, follow the steps given below :
|
|
|
|
|
|
|
|
Clone the project by downloading the ZIP from the [GitHub page](https://github.com/rust-lang/reference) or
|
|
|
|
run the following command:
|
|
|
|
|
|
|
|
```
|
|
|
|
git clone https://github.com/rust-lang/reference
|
|
|
|
```
|
|
|
|
|
|
|
|
Change the directory to the downloaded repository:
|
2017-07-15 16:26:00 +00:00
|
|
|
|
2020-06-02 15:43:00 +00:00
|
|
|
```sh
|
2017-07-15 16:26:00 +00:00
|
|
|
cd reference
|
2021-01-17 16:00:02 +00:00
|
|
|
```
|
|
|
|
Run the following command to test the code snippets to catch compilation errors:
|
|
|
|
|
|
|
|
```shell
|
2017-07-15 16:26:00 +00:00
|
|
|
mdbook test
|
|
|
|
```
|
|
|
|
|
2021-01-17 16:00:02 +00:00
|
|
|
|
|
|
|
To generate a local instance of the book, run:
|
2017-07-15 16:26:00 +00:00
|
|
|
|
2020-06-02 15:43:00 +00:00
|
|
|
```sh
|
2017-07-15 16:26:00 +00:00
|
|
|
mdbook build
|
|
|
|
```
|
|
|
|
|
2020-08-03 07:35:05 +00:00
|
|
|
The generated HTML will be in the `book` folder.
|