# rust-lang/book: What the Official Rust Book Repository Actually Contains

> The rust-lang/book repository is the mdBook source behind The Rust Programming Language, not a downloadable PDF or EPUB. Here is what you can build from it, what the maintainers say about contribution latency, and where the repository stops.

**rust-lang/book** — The Rust Programming Language

- Repository: https://github.com/rust-lang/book
- Website: https://doc.rust-lang.org/book/
- Stars: 18,351 · Forks: 4,144
- Language: Rust
- License: NOASSERTION
- Published: 2026-09-21 · Updated: 2026-09-21 · Language: en
- Canonical page: https://hysenlabs.com/projects/rust-lang-book

## What rust-lang/book Is and Who It Is For

This repository holds the source of The Rust Programming Language, the book the README describes as available in dead-tree form from No Starch Press and free online in the stable, beta, and nightly Rust releases. The distinction matters: the repository is the manuscript, not the distribution channel. If you only want to read the book, the README points you at doc.rust-lang.org. If you want to build it, vendor it, translate it, or fix an error in it, you are the intended audience.

The README also notes that issues in the shipped stable, beta, and nightly versions may already be fixed in the repository, because those releases are updated less frequently. That single sentence is the strongest argument for cloning rather than reading the packaged copy: the repository is ahead of what rustup ships.

A second audience is translators. The README asks for help translating the book, points to the Translations label for efforts in progress, and says to open an issue to start a new language. It also states that merging translations is blocked on mdbook support for multiple languages, referencing mdBook issue 5. That is an honest admission that translation work can start before it can land.

## How the Book Is Assembled: mdBook, src/, and packages/trpl

The mechanism is mdBook. Configuration lives in book.toml at the repository root, chapter sources live in src/, and the build output lands in a book subdirectory. The top-level layout also carries first-edition/, second-edition/, and 2018-edition/ directories, plus nostarch/, theme/, ferris.css, ferris.js, and redirects/, which is consistent with a project that has shipped multiple print and online revisions and keeps the older ones in the tree.

Code examples are not scattered prose. The workspace Cargo.toml defines members = ["packages/tools"] and excludes linkchecker, listings, and tmp, with a comment that listings are built in tmp when output is updated via tools/update-rustc.sh. So the testable code the book embeds is generated and checked by tooling rather than hand-copied, and the listings directory is deliberately outside the workspace.

The README's test command targets packages/trpl, which is where the book's own crate lives. That is the data flow in practice: markdown in src/, mdBook renders it, and mdbook test compiles the embedded examples against the deps directory built under packages/trpl/target.

## Installing mdBook and Building the Book Offline

The README lists one requirement: mdBook, ideally the same version rust-lang/rust uses in src/tools/rustbook/Cargo.toml. It does not name that version, so you have to follow the link. The install command it gives is:

```bash
$ cargo install mdbook --locked --version <version_num>
```

The placeholder is the README's own; substitute the version from the rust-lang/rust file. Then build:

```bash
$ mdbook build
```

The README states the output will be in the book subdirectory. Open book/index.html in a browser. The README gives per-platform commands, including these for Firefox on Linux and macOS:

```bash
$ firefox book/index.html                       # Linux
$ open -a "Firefox" book/index.html             # OS X
```

If you want to run the book's tests rather than just render it, the README's sequence is:

```bash
$ cd packages/trpl
$ mdbook test --library-path packages/trpl/target/debug/deps
```

That is the whole first-use path. There is no installer, no service, and no configuration file to edit before the first build.

## What the Repository Does Not Give You: PDF, EPUB, and Print Text

People search for a Rust book PDF, an EPUB, and download links, and the repository is not that. mdBook produces HTML; the README documents book/index.html and nothing else as output. The README points to the releases page for the code of all the code listings that appear in the book, which is source code, not a formatted ebook. The print edition is a No Starch Press product, linked from the README as a separate thing.

There is also a licensing wrinkle worth naming plainly. The repository metadata reports the licence as NOASSERTION, while the top-level file listing shows LICENSE-APACHE and LICENSE-MIT, the usual Rust project pairing. If you plan to redistribute a build or a translation, read both files and the COPYRIGHT file at the root; this article cannot tell you what they permit.

A third gap: the README does not document rollback, versioned book output, or how to pin a build to a specific Rust release. If you need a frozen snapshot of the book text, the repository does not describe a supported way to produce one.

## Contributing to rust-lang/book: The Months-or-Years Latency

The README is unusually direct about this. Because the book is printed, and because the maintainers want the online version close to the print version, it may take longer than usual to address an issue or pull request. Between larger revisions tied to Rust Editions, they say they will only be correcting errors. Anything that is not strictly fixing an error might sit until the next large revision, with an expectation on the order of months or years.

That changes how you should use the repository. If you find a typo or a factual error, a pull request is the right move and CONTRIBUTING.md is the document to read first. If you want to restructure a chapter, add a new topic, or reword an explanation you find unclear, the README has already told you the answer is probably no for now. Filing it anyway is not harmful, but planning a schedule around it is.

The spellchecking path is the one piece of contributor tooling the README spells out. The ci directory holds spellcheck.sh, which needs ci/dictionary.txt. A false positive, such as BTreeMap, is resolved by adding the word to ci/dictionary.txt while keeping sorted order. That is a concrete, low-risk first contribution.

## How rust-lang/book Differs from Rust by Example and the Reference

Rust by Example is a separate project with a different shape: it teaches through runnable snippets organized by topic, and it is not the book. The book is narrative, ordered, and written to be read front to back, which is why it is the artifact No Starch prints. If your goal is to look up a specific API behaviour, neither is the right tool; the standard library documentation and the Rust Reference serve that purpose, and the book is not organized for lookup.

Within the repository itself there is a second comparison: the edition directories. first-edition/, second-edition/, and 2018-edition/ sit alongside src/, and the release list shows a nostarch-third-printing release tagged for the Rust 2024 print edition, plus an async-2024 release that added an async chapter. So the repository carries both the current text and its own history. If you are reading a second-edition PDF from elsewhere, you are reading material this repository has moved past, and the README's warning about stale packaged versions applies with more force to those older editions.

## Maintenance Signals and Upgrade Cost

The repository is not archived, and the last push was on 2026-09-02, which is recent enough that the project is under current work. The release history is sparser than the push history: nostarch-third-printing on 2025-12-19, async-2024 on 2024-11-07, and rand-0.8 back on 2021-02-18. That pattern matches the README's own description of large revisions coinciding with Rust Editions and error fixes in between.

Upgrade cost for a reader is low. Pull the repository, rebuild with mdbook build, and you have the current text. The one moving part is the mdBook version, which the README wants matched to what rust-lang/rust uses; a mismatched mdBook is the most likely source of a build that renders differently from the published book. The rust-toolchain file at the root pins the toolchain the repository expects.

Upgrade cost for a translator is higher, and the README is explicit that mdbook support for multiple languages is the blocker before any translation merges. Starting a translation today means tracking a moving source with no merge path documented in the README. The Cargo.toml workspace dependencies include walkdir, docopt, serde, regex, lazy_static, flate2, and tar, which is the tooling surface you inherit if you work on the packages/tools side.

## Conclusion

Adopt rust-lang/book if you want the book built locally, vendored offline, or translated, and if you accept that non-error pull requests can sit for months or years while the maintainers work toward Rust Editions. Do not adopt it as a general Rust learning path if you have not first read the free online version at doc.rust-lang.org/book, or if you need a PDF or EPUB, which the README never promises. Before contributing, read CONTRIBUTING.md, then confirm the mdBook version pinned in rust-lang/rust's src/tools/rustbook/Cargo.toml, because the README asks for ideally the same version and the repository does not restate it.

## FAQ

### Is Rust Lang worth it?

The repository does not make that case; it is the source of the book that teaches the language. The README frames the book as available free online with stable, beta, and nightly Rust, and in print from No Starch Press, so the material to judge for yourself is the book itself.

### Why is Rust Lang called Rust?

The README does not explain the name's origin. It only describes the book and how to build it, so this question is outside what the repository documents.

### Is Rust Lang still popular?

The README gives no popularity data. What it does show is that the book is still being revised: the repository is not archived, and the release list includes a nostarch-third-printing release for the Rust 2024 print edition.

### How to learn Rust Lang?

The README points readers at the free online book shipped with the stable, beta, and nightly Rust releases, and notes that issues in those versions may already be fixed in this repository because those releases are updated less frequently.

## Sources

- [Issues](https://github.com/rust-lang/book/issues)
- [Project website](https://doc.rust-lang.org/book/)
- [README](https://github.com/rust-lang/book/blob/main/README.md)
- [Releases](https://github.com/rust-lang/book/releases)
- [rust-lang/book on GitHub](https://github.com/rust-lang/book)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/rust-lang-book
