3 ms·
The "rules" that the borrow checker enforces are the rules of functional programming, except in an extended form that adds flexibility to many tasks as opposed
by zozbot234 7y ago
The "rules" that the borrow checker enforces are the rules of functional programming, except in an extended form that adds flexibility to many tasks as opposed to removing it. The main point is to not share and mutate objects at the same time, because that comes with inherently unclear semantics and a high potential for bugs. (Rust has mechanisms for shared mutability, but even those trigger runtime checks to ensure you aren't actually doing anything that would be bug-prone in that way.)