3 ms·
Ah, I guess I did misunderstand then. I see now rereading that the "don't treat as a mutable borrow until first write" is already how things behave today and ha
by saghm 3y ago
Ah, I guess I did misunderstand then. I see now rereading that the "don't treat as a mutable borrow until first write" is already how things behave today and have since NLL.
- k1t 3y agoThat's not really true. If it were, this would compile since there are no writes. fn main() { let mut x = [1,2,3,4,5]; let y = &mut x[0]; let z = &x[1]; println!("y {}... z {} ", y, z); } But it doesn't.