The Rust Programming Language
This version of the text assumes you’re using Rust 1.52 or later with in Cargo.toml of all projects to use Rust 2018 Edition idioms. See the to install or update Rust, and see the new Appendix E for information on editions.
- Chapter 7, “Managing Growing Projects with Packages, Crates, and Modules,” has been mostly rewritten. The module system and the way paths work in the 2018 Edition were made more consistent.
- Chapter 10 has new sections titled “Traits as Parameters” and “Returning Types that Implement Traits” that explain the new
impl Trait
syntax. - The “Advanced Lifetimes” section in Chapter 19 was removed because compiler improvements have made the constructs in that section even rarer.
- The previous Appendix D, “Macros,” has been expanded to include procedural macros and was moved to the “Macros” section in Chapter 19.
- Appendix D is now titled “Useful Development Tools” and covers recently released tools that help you write Rust code.
- We fixed a number of small errors and imprecise wording throughout the book. Thank you to the readers who reported them!
Note that any code in earlier iterations of The Rust Programming Language that compiled will continue to compile without in the project’s Cargo.toml, even as you update the Rust compiler version you’re using. That’s Rust’s backward compatibility guarantees at work!
This text is available in .