-
Notifications
You must be signed in to change notification settings - Fork 10.5k
temporarily prevent Copyable types from using consuming
and borrowing
#65570
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
temporarily prevent Copyable types from using consuming
and borrowing
#65570
Conversation
@swift-ci please test |
@kavon this looks good to me. Except, can you add a flag that disables this for testing cases. Or change the tests that use this to use __shared/etc. Personally, I would rather the tests just have a special flag that way we future proof and don't have to change them in the future. |
7253a70
to
2b0bd31
Compare
2b0bd31
to
6b16b82
Compare
@gottesmm I went with guarding the ability to write it behind |
@swift-ci please test |
6b16b82
to
fa7e628
Compare
@swift-ci please smoke test |
…ing` There is a strong desire for "no-implicit-copy" semantics to be applied to Copyable values marked with the newer `borrowing` and `consuming` ownership specifiers. If we lock ourselves into what SE-390 specifies now for Copyable types in the implementation, then we'll have to introduce a source break when we want such values to have the desired semantics. Before there's wider adoption, I'm making it an error to use those newer names. If for some reason this is enabling a critical optimization for your use case, please use the old names instead: - `__owned` for `consuming` parameters - `__consuming` for `consuming` methods - `__shared` for `borrowing` parameters NOTE: the older names have their ownership attribute mangled into the name of the function itself, so there's a possibility of ABI breaks in the future if you move from the old name to the new one. There is some consideration being made to allow for a migration to the new names in the future without breaking ABI, so do reach out if this is an issue for you. resolves rdar://108538971
part of resolving rdar://108538971
fa7e628
to
87f190b
Compare
@swift-ci please smoke test |
There is a strong desire for "no-implicit-copy" semantics to be applied to Copyable values marked with the newer
borrowing
andconsuming
ownership specifiers. If we lock ourselves into what SE-390 specifies now for Copyable types in the implementation, then we'll have to introduce a source break when we want such values to have the desired semantics.Before there's wider adoption, I'm making it an error to use those newer names. If for some reason this is enabling a critical optimization for your use case, please use the old names instead:
__owned
forconsuming
parameters__consuming
forconsuming
methods__shared
forborrowing
parametersNOTE: the older names have their ownership attribute mangled into
the name of the function itself, so there's a possibility of ABI
breaks in the future if you move from the old name to the new one.
There is some consideration being made to allow for a migration to
the new names in the future without breaking ABI, so do reach out if
this is an issue for you.
resolves rdar://108538971