Practice
Learn
← Quit
0 / 0 correct
Rust
Hard
1 of 10
Does this compile?
let mut v = vec![1, 2, 3]; v.push(v.len());
A
No: v is borrowed mutably and immutably
B
No: len() returns usize, push expects i32
C
Yes, thanks to two-phase borrows: the mutable borrow for push is activated after v.len() is evaluated
D
Only in nightly