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

This code compiles only under Non-Lexical Lifetimes (NLL), not under the older lexical borrow checker. What property of NLL is responsible?

let mut v = vec![1, 2, 3]; let r = &v[0]; println!("{}", r); v.push(4);