nll-rfc
nll-rfc copied to clipboard
2-Phase Borrows
The NLL RFC does not include any description of 2-phase borrows, which are required in order to enable nested method calls aka rust-lang/rfcs#2025:
x.push(x.len());
Or the MIR equivalent
tmp0 = &'a mut vec;
tmp1 = &'b vec;
tmp2 = Vec::len(tmp1);
Vec::push(tmp0, tmp2);
Yeah, I intentionally left them out because I kind of ran out of time and it seemed fairly orthogonal to me. But it would be good to include. I was intending to simply "port" the approach described in rust-lang/rfcs#2025, at least for now.