Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2-Phase Borrows #37

Open
arielb1 opened this issue Aug 14, 2017 · 1 comment
Open

2-Phase Borrows #37

arielb1 opened this issue Aug 14, 2017 · 1 comment

Comments

@arielb1
Copy link

arielb1 commented Aug 14, 2017

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);
@nikomatsakis
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants