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

Provide more information about the RFC2229 and migration information #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

roxelo
Copy link
Member

@roxelo roxelo commented Jul 1, 2021

  • Should I be linking to the rust reference instead? All the information in one place would make sense
  • How much info is needed to be provided about migration?
  • Should we be adding info about filling bugs and closure profiling here?

@roxelo roxelo marked this pull request as ready for review July 1, 2021 16:11
}); // Closure captured px.0 which is not Send
```

## Capture Precision
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not this section

As for all edition changes, an automatic migration is available.
If you would like to be warned of semantics change that may impact your code, you can [use the lint](https://doc.rust-lang.org/rustc/lints/levels.html) `disjoint_capture_migrations`. The lint is also supported with [cargo fix](https://doc.rust-lang.org/cargo/commands/cargo-fix.html) to automatically migrate your code.

The migration fix involves adding `let _ = &a;`, where `a` is the variable that needs to be fully captures, inside the closure to force the entire
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

full captured

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entire variable to be captured as before

If you would like to be warned of semantics change that may impact your code, you can [use the lint](https://doc.rust-lang.org/rustc/lints/levels.html) `disjoint_capture_migrations`. The lint is also supported with [cargo fix](https://doc.rust-lang.org/cargo/commands/cargo-fix.html) to automatically migrate your code.

The migration fix involves adding `let _ = &a;`, where `a` is the variable that needs to be fully captures, inside the closure to force the entire
struct to be captured as before.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant variable here

@roxelo roxelo force-pushed the rfc2229-info branch 2 times, most recently from cee12c4 to cbde8bb Compare July 1, 2021 17:52
roxelo and others added 2 commits July 2, 2021 09:33
Co-authored-by: Ryan Levick <[email protected]>
Co-authored-by: Eric Huss <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants