Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRustborrow checker and NLLSingle-choice MCQ

Consider this code, which compiles under NLL but would have failed pre-NLL. What is the precise reason NLL accepts it?

fn main() { let mut v = vec![1, 2, 3]; let r = &mut v; r.push(4); println!("{}", r[0]); // r is never used again println!("{}", v.len()); }