]>
Commit | Line | Data |
---|---|---|
9fa01778 XL |
1 | # The Rust Programming Language |
2 | ||
532ac7d7 XL |
3 | *by Steve Klabnik and Carol Nichols, with contributions from the Rust Community* |
4 | ||
74b04a01 | 5 | This version of the text assumes you’re using Rust 1.41.0 or later with |
416331ca XL |
6 | `edition="2018"` in *Cargo.toml* of all projects to use Rust 2018 Edition |
7 | idioms. See the [“Installation” section of Chapter 1][install]<!-- ignore --> | |
8 | to install or update Rust, and see the new [Appendix E][editions]<!-- ignore | |
9 | --> for information on editions. | |
48663c56 | 10 | |
dc9dc135 | 11 | The 2018 Edition of the Rust language includes a number of improvements that |
416331ca | 12 | make Rust more ergonomic and easier to learn. This iteration of the book |
dc9dc135 | 13 | contains a number of changes to reflect those improvements: |
48663c56 | 14 | |
dc9dc135 | 15 | - Chapter 7, “Managing Growing Projects with Packages, Crates, and Modules,” |
48663c56 | 16 | has been mostly rewritten. The module system and the way paths work in the |
dc9dc135 XL |
17 | 2018 Edition were made more consistent. |
18 | - Chapter 10 has new sections titled “Traits as Parameters” and “Returning | |
19 | Types that Implement Traits” that explain the new `impl Trait` syntax. | |
20 | - Chapter 11 has a new section titled “Using `Result<T, E>` in Tests” that | |
21 | shows how to write tests that use the `?` operator. | |
416331ca | 22 | - The “Advanced Lifetimes” section in Chapter 19 was removed because compiler |
dc9dc135 XL |
23 | improvements have made the constructs in that section even rarer. |
24 | - The previous Appendix D, “Macros,” has been expanded to include procedural | |
25 | macros and was moved to the “Macros” section in Chapter 19. | |
26 | - Appendix A, “Keywords,” also explains the new raw identifiers feature that | |
27 | enables code written in the 2015 Edition and the 2018 Edition to interoperate. | |
28 | - Appendix D is now titled “Useful Development Tools” and covers recently | |
29 | released tools that help you write Rust code. | |
48663c56 XL |
30 | - We fixed a number of small errors and imprecise wording throughout the book. |
31 | Thank you to the readers who reported them! | |
32 | ||
416331ca | 33 | Note that any code in earlier iterations of *The Rust Programming Language* |
48663c56 | 34 | that compiled will continue to compile without `edition="2018"` in the |
dc9dc135 XL |
35 | project’s *Cargo.toml*, even as you update the Rust compiler version you’re |
36 | using. That’s Rust’s backward compatibility guarantees at work! | |
9fa01778 XL |
37 | |
38 | The HTML format is available online at | |
39 | [https://doc.rust-lang.org/stable/book/](https://doc.rust-lang.org/stable/book/) | |
40 | and offline with installations of Rust made with `rustup`; run `rustup docs | |
41 | --book` to open. | |
42 | ||
43 | This text is available in [paperback and ebook format from No Starch | |
44 | Press][nsprust]. | |
45 | ||
46 | [install]: ch01-01-installation.html | |
47 | [editions]: appendix-05-editions.html | |
48 | [nsprust]: https://nostarch.com/rust |