-
Notifications
You must be signed in to change notification settings - Fork 13.3k
2229: Don't capture preicese paths on top of a union #87469
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
Conversation
- Accessing fields of a union require unsafe block - As part of 2229 we don't allow precision where we need an unsafe block to capture. Fixes: rust-lang#87378 r? @nikomatsakis
@bors r+ |
📌 Commit 75edcd9 has been approved by |
@@ -1760,12 +1760,11 @@ impl<'a, 'tcx> euv::Delegate<'tcx> for InferBorrowKind<'a, 'tcx> { | |||
self.borrow(assignee_place, diag_expr_id, ty::BorrowKind::MutBorrow); | |||
} | |||
} | |||
|
|||
/// Truncate projections so that following rules are obeyed by the captured `place`: | |||
/// Truncate `place` so that an `unsafe` block isn't required to capture it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the removed newline above this doc comment. (Don't worry about it, no need to block this one from landing. A drive-by fix in one of your next PRs is fine).
/// Truncate projections so that following rules are obeyed by the captured `place`: | ||
/// - No Index projections are captured, since arrays are captured completely. | ||
/// - No unsafe block is required to capture `place` | ||
/// Truncate projections so that following rules are obeyed by the captured `place`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here the first line of the doc comment is duplicated as the last line.
☀️ Test successful - checks-actions |
to capture.
Fixes: #87378
r? @nikomatsakis