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