Skip to content
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

[SE-0430] Remove borrowing sending example and update ownership rules #2687

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions proposals/0430-transferring-parameters-and-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,18 +390,12 @@ the callee. Unlike `consuming` parameters, `sending` parameters do not
have no-implicit-copying semantics.

To opt into no-implicit-copying semantics or to change the default ownership
convention, `sending` may also be paired with an explicit `consuming` or
`borrowing` ownership modifier:
convention, `sending` may also be paired with an explicit `consuming` ownership modifier:

```swift
func sendingConsuming(_ x: consuming sending T) { ... }
func sendingBorrowing(_ x: borrowing sending T) { ... }
```

Note that an explicit `borrowing` annotation always implies no-implicit-copying,
so there is no way to change the default ownership convention of a
`sending` parameter without also opting into no-implicit-copying semantics.

### Adoption in the Concurrency library

There are several APIs in the concurrency library that send a parameter across
Expand Down