Chapter 1 - Introduction
-
Introduction
I’m a long term C++ programmer who is coming to Rust with lots of baggage. I’d like to write Rust in an idiomatic style but I may end up writing bad Rust in a C++ style. Hopefully people will help me avoid that. I’ve read … -
1.1 - Lifetimes
One of the jobs of the Rust compiler’s “borrow checker” is to track the life of each reference to a variable so that it can prevent dangling references. To do this, it annotates each variable and reference with details of … -
1.1 - Borrowing mutable references
In addition to managing the lifetimes of references to variables, the Rust compiler’s borrow checker also deals with enforcing Rust’s guarantees about mutability and so helps to prevent data races. Basically, you can have any …