rust-lang /book

The Rust Programming Language

★ 18,571⑂ 4,183👁 223⑃ 2,719● 2,159▤ 4
RustNOASSERTIONCreated 2015-12-11doc.rust-lang.org/book/
下载:Rust 2024 Print Editionnostarch-third-printing ↓nostarch-third-printing2025-12-19
+2
日增长
18,571
stars
4,183
forks
223
watchers
2,719
prs
2,159
issues
4
releases

README

The Rust Programming Language

!Build Status

This repository contains the source of "The Rust Programming Language" book.

[The book is available in dead-tree form from No Starch Press][nostarch].

[nostarch]: https://nostarch.com/rust-programming-language-2nd-edition

You can also read the book for free online. Please see the book as shipped with
the latest [stable], [beta], or [nightly] Rust releases. Be aware that issues
in those versions may have been fixed in this repository already, as those
releases are updated less frequently.

[stable]: https://doc.rust-lang.org/stable/book/
[beta]: https://doc.rust-lang.org/beta/book/
[nightly]: https://doc.rust-lang.org/nightly/book/

See the [releases] to download just the code of all the code listings that appear in the book.

[releases]: https://github.com/rust-lang/book/releases

 Requirements

Building the book requires [mdBook], ideally the same version that
rust-lang/rust uses in [this file][rust-mdbook]. To get it:

[mdBook]: https://github.com/rust-lang/mdBook
[rust-mdbook]: https://github.com/rust-lang/rust/blob/HEAD/src/tools/rustbook/Cargo.toml

bash
$ cargo install mdbook --locked --version 


 Building

To build the book, type:

bash
$ mdbook build


The output will be in the book subdirectory. To check it out, open it in
your web browser.

_Firefox:_

bash
$ firefox book/index.html                        Linux
$ open -a "Firefox" book/index.html              OS X
$ Start-Process "firefox.exe" .\book\index.html  Windows (PowerShell)
$ start firefox.exe .\book\index.html            Windows (Cmd)


_Chrome:_

bash
$ google-chrome book/index.html                  Linux
$ open -a "Google Chrome" book/index.html        OS X
$ Start-Process "chrome.exe" .\book\index.html   Windows (PowerShell)
$ start chrome.exe .\book\index.html             Windows (Cmd)


To run the tests:

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


 Contributing

We'd love your help! Please see [CONTRIBUTING.md][contrib] to learn about the
kinds of contributions we're looking for.

[contrib]: https://github.com/rust-lang/book/blob/main/CONTRIBUTING.md

Because the book is [printed][nostarch], and because we want
to keep the online version of the book close to the print version when
possible, it may take longer than you're used to for us to address your issue
or pull request.

So far, we've been doing a larger revision to coincide with Rust Editions. Between those larger
revisions, we will only be correcting errors. If your issue or pull request
isn't strictly fixing an error, it might sit until the next time that we're
working on a large revision: expect on the order of months or years. Thank you
for your patience!

 Translations

We'd love help translating the book! See the [Translations] label to join in
efforts that are currently in progress. Open a new issue to start working on
a new language! We're waiting on [mdbook support] for multiple languages
before we merge any in, but

Top issues

Latest release

Rust 2024 Print Edition nostarch-third-printing 2025-12-19
Text and code corresponding to the printing released on February 2026. 

ISBN-13: 9781718504448 
Available from https://nostarch.com/rust-programming-language-3rd-edition

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON