-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
2229: Fix issues with move closures and mutability #80092
Merged
Merged
Commits on Jan 29, 2021
-
Restrict precision of captures with
capture_disjoint_fields
set- No Derefs in move closure, this will result in value behind a reference getting moved. - No projections are applied to raw pointers, since these require unsafe blocks. We capture them completely. Motivations for these are recorded here: https://hackmd.io/71qq-IOpTNqzMkPpAI1dVg?view
Configuration menu - View commit details
-
Copy full SHA for b421cd5 - Browse repository at this point
Copy the full SHA b421cd5View commit details -
Compute mutability of closure captures
When `capture_disjoint_fields` is not enabled, checking if the root variable binding is mutable would suffice. However with the feature enabled, the captured place might be mutable because it dereferences a mutable reference. This PR computes the mutability of each capture after capture analysis in rustc_typeck. We store this in `ty::CapturedPlace` and then use `ty::CapturedPlace::mutability` in mir_build and borrow_check.
Configuration menu - View commit details
-
Copy full SHA for 3488082 - Browse repository at this point
Copy the full SHA 3488082View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1373f98 - Browse repository at this point
Copy the full SHA 1373f98View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0897db5 - Browse repository at this point
Copy the full SHA 0897db5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 604cbdc - Browse repository at this point
Copy the full SHA 604cbdcView commit details -
Configuration menu - View commit details
-
Copy full SHA for c748f32 - Browse repository at this point
Copy the full SHA c748f32View commit details -
Configuration menu - View commit details
-
Copy full SHA for ffd5327 - Browse repository at this point
Copy the full SHA ffd5327View commit details -
Configuration menu - View commit details
-
Copy full SHA for fadf03e - Browse repository at this point
Copy the full SHA fadf03eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f4bab2 - Browse repository at this point
Copy the full SHA 0f4bab2View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.