Skip to content

_forget usage fixes to match SE-390 #65690

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
merged 3 commits into from
May 6, 2023
Merged

Conversation

kavon
Copy link
Member

@kavon kavon commented May 5, 2023

Contains a bundle of fixes for the _forget statement in terms of its legal usages to match the conclusions of SE-390 review. The changes are detailed in each commit.

rdar://108877261

@kavon kavon requested review from hborla, slavapestov and xedin as code owners May 5, 2023 06:54
@kavon
Copy link
Member Author

kavon commented May 5, 2023

@swift-ci please smoke test

@kavon kavon changed the title Forget usage fixes to match SE-390 _forget usage fixes to match SE-390 May 5, 2023
kavon added 2 commits May 5, 2023 14:50
we decided against allowing it for now.

rdar://108877261
@kavon kavon force-pushed the forget-usage-fixes branch 2 times, most recently from a4c651a to ea16bc4 Compare May 6, 2023 02:04
We haven't quite got the semantics we want implemented
for `discard` aka `_forget` statements. Allowing people
to use `_forget` in noncopyable types that have stored
properties that require destruction will not let us
implement it the way we'd like in the future without
source break. But, if the type only has "trivial" stored
properties with a no-op destruction, like `Int`, then we
can still provide utility for users like FileDescriptor
who just want to disable the deinit and have nothing
fancy stored in the type itself.

rdar://108877261
@kavon kavon force-pushed the forget-usage-fixes branch from ea16bc4 to 578da49 Compare May 6, 2023 02:05
@kavon
Copy link
Member Author

kavon commented May 6, 2023

@swift-ci please test

@kavon kavon requested review from jckarter and gottesmm May 6, 2023 02:06
@kavon kavon merged commit c260792 into swiftlang:main May 6, 2023
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