-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Adopt stable keyword consuming instead of __owned #65571
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
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.
At least on main
, there doesn't appear to be any issue with having an __owned
parameter requirement being witnessed by a consuming
method's parameter.
So far I think it's fine to change the methods as those won't lead to any ABI break, but...
b068a4c
to
5455f33
Compare
@swift-ci please smoke test |
test/Concurrency/Runtime/custom_executors_sdk_with_consuming_param_but_impl_owned.swift
Outdated
Show resolved
Hide resolved
test/Inputs/clang-importer-sdk/swift-modules-concurrency-consuming-job-param/_Concurrency.swift
Outdated
Show resolved
Hide resolved
@swift-ci please smoke test |
Depends on #65455 since that introduces new methods; so we want to do the same to the new ones IF we are to merge these new methods. |
@swift-ci please smoke test macOS |
29cffc7
to
51db03f
Compare
add test for warnings emitted when missing consuming attribute use -emit-sil in mock SDK tests for better coverage
51db03f
to
da6f08a
Compare
@swift-ci please smoke test |
@swift-ci please smoke test Windows |
This change is ABI stable with regards to the mangled name of the enqueue method.
We confirmed this by manually comparing mangled names of a method with
__owned
and later aconsuming
parameter -- please double check this though @kavon as you'd know more about this than myself.This also improves diagnostics around implementing move-only job requirement, since the diagnostics offered by
__owned
are wrong: they don't show the attribute leading people to addfunc enqueue(_ job: ExecutorJob)
which is incorrect because they MUST add consuming.This PR includes tests that simulate an SDK with either the __owned or consuming versions and implementations with the other spelling, to make sure this works as expected.
Please review @kavon
Resolves rdar://108467550