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

[NLL] Should this code compile with NLL? #67201

Closed
quixoticaxis opened this issue Dec 10, 2019 · 1 comment
Closed

[NLL] Should this code compile with NLL? #67201

quixoticaxis opened this issue Dec 10, 2019 · 1 comment

Comments

@quixoticaxis
Copy link

Here's the code:

fn main() {
    let mut v = vec![1, 2, 3];
    v.swap(0, v.iter().position(|num| *num == 3).unwrap());
}

Should this code compile? And what is the right place to ask questions about it?
I've got here following some awesome rustaceans' advises to read this RFC and then this tracking issue.

@jonas-schievink
Copy link
Contributor

No, I believe this needs full two-phase borrows (#46901).

And what is the right place to ask questions about it?

It's best to ask question on the user forum, the /r/rust subreddit, or Discord (or any other chat platform used by Rustaceans). If it's something about the feature tracked by the tracking issue, that isn't outlined in the RFC, then it might also be appropriate to drop a comment in the tracking issue.

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

No branches or pull requests

2 participants