3 ms·
Exactly. You can have as many immutable references to an object as you want, or you can have one mutable reference to it, not both. (Each of those references is
by db48x 10y ago
Exactly. You can have as many immutable references to an object as you want, or you can have one mutable reference to it, not both. (Each of those references is how you borrow something from the real owner, hence the name.)
The borrow checker is that part of the compiler that makes sure that these borrowing rules are followed. Other rules are implemented by other parts of the compiler; the type system has the job of making sure you don't try to write to something that you only have an immutable reference to, for example.