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