Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRusttwo-phase borrowsSingle-choice MCQ

Two-phase borrows were added largely to make this kind of code compile. What is the actual mechanism that lets it pass the borrow checker?

fn main() { let mut v = vec![1, 2, 3]; v.push(v.len()); }