Skip to content

[6.0] Disallow consuming self in a noncopyable deinit again. #75567

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 Jul 30, 2024

Explanation: Disables the ability to pass self as a consuming parameter out of a deinit. Changes to allow partial consumption accidentally also allow this case, which we have not yet fully designed the semantics for.
Scope: Disables an unwanted language feature.
Issue: rdar://132761460
Original PR: #75560
Risk: Low. Disables functionality that was accidentally added.
Testing: Swift CI
Reviewer: @kavon

The changes to allow for partial consumption unintentionally also allowed for
`self` to be consumed as a whole during `deinit`, which we don't yet want to
allow because it could lead to accidental "resurrection" and/or accidental
infinite recursion if the consuming method lets `deinit` be implicitly run
again. This makes it an error again. The experimental feature
`ConsumeSelfInDeinit` will allow it for test coverage or experimentation
purposes. rdar://132761460
@jckarter jckarter requested a review from a team as a code owner July 30, 2024 15:38
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter merged commit 7441cef into swiftlang:release/6.0 Jul 30, 2024
5 checks passed
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