borrow checker
The part of the compiler that enforces the borrowing rules.
The borrow checker verifies that references never conflict (many shared or one mutable) and never outlive their referents.
Loading interactive…
Examples
let first = &v[0]; v.push(4); println!("{first}");is rejected with E0502:pushneedsvmutably whilefirststill borrows it.
See also