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

closure capture migrations do not note when move is now required #88114

Open
m-ou-se opened this issue Aug 17, 2021 · 4 comments
Open

closure capture migrations do not note when move is now required #88114

m-ou-se opened this issue Aug 17, 2021 · 4 comments
Labels
A-closures Area: closures (`|args| { .. }`) A-edition-2021 Area: The 2021 edition T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@m-ou-se m-ou-se added A-closures Area: closures (`|args| { .. }`) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-edition-2021 Area: The 2021 edition labels Aug 17, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Aug 17, 2021

cc @rust-lang/wg-rfc-2229 (This is the issue for the problem I mentioned here.)

@m-ou-se m-ou-se added this to Migration crater run blockers in 2021 Edition Blockers Aug 17, 2021
@m-ou-se m-ou-se moved this from Migration crater run blockers to Not-really blockers (?) in 2021 Edition Blockers Aug 17, 2021
@roxelo
Copy link
Member

roxelo commented Aug 19, 2021

@arora-aman I think you may have more context on this one

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Aug 24, 2021

We discussed this on Zulip. The root cause here is that sometimes move mode is not required for a thread-spawn because the closure the only upvar that a closure referenced, it used to move -- but now, in Rust 2021, because we have a more precise path, we are able to get away with a copy, which winds up being "by ref" (playground).

This is a migration failure but we decided to not fix it, it's a bit annoying, but instead just leave a comment in the Rust 2021 Edition guide explaining that this scenario comes up in some isolated cases and suggesting how to fix it.

Therefore: the fix will be opening a PR against rust-lang/edition-guide (which can close this issue).

@arora-aman
Copy link
Member

@nikomatsakis another case: #88444

@nikomatsakis nikomatsakis changed the title Closure captures migration missing some cases closure capture migrations do not note when move is now required Aug 30, 2021
@m-ou-se m-ou-se moved this from Not-really blockers (?) to Documentation in 2021 Edition Blockers Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: closures (`|args| { .. }`) A-edition-2021 Area: The 2021 edition T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
2021 Edition Blockers
  
Documentation
Development

No branches or pull requests

4 participants