Skip to content

Consistently mark borrowing and consuming parameters for move-only checking when captured. #73380

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

Merged

Conversation

jckarter
Copy link
Contributor

@jckarter jckarter commented May 1, 2024

When a borrowing or consuming parameter is captured by a closure, we emit references to the binding within the closure as if it is non-implicitly copyable, but we didn't mark the bindings inside the closure for move-only checking to ensure the uses were correct, so improper consumes would go undiagnosed and lead to assertion failures, compiler crashes, and/or miscompiles. Fixes rdar://127382105

…y checking when captured.

When a `borrowing` or `consuming` parameter is captured by a closure,
we emit references to the binding within the closure as if it is non-implicitly
copyable, but we didn't mark the bindings inside the closure for move-only
checking to ensure the uses were correct, so improper consumes would go
undiagnosed and lead to assertion failures, compiler crashes, and/or
miscompiles. Fixes rdar://127382105
@jckarter jckarter requested a review from kavon as a code owner May 1, 2024 20:48
@jckarter
Copy link
Contributor Author

jckarter commented May 1, 2024

@swift-ci Please test

@jckarter
Copy link
Contributor Author

jckarter commented May 1, 2024

@swift-ci Please test source compatibility

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.

1 participant