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

Two-phase borrows handle nested method-call autoref, but they have a strict limit: the reservation only tolerates *shared* reads in the gap, not other unique borrows. Why is the following still rejected even though it superficially looks like the `v.push(v.len())` pattern?

let mut v = vec![1, 2, 3]; v.push(v.pop().unwrap());