Skip to content

Mark a bunch of proposals as implemented in Swift 6.0. #2496

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
Jun 19, 2024
Merged
Show file tree
Hide file tree
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
46 changes: 42 additions & 4 deletions proposals/0414-region-based-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Proposal: [SE-0414](0414-region-based-isolation.md)
* Authors: [Michael Gottesman](https://github.com/gottesmm) [Joshua Turcotti](https://github.com/jturcotti)
* Review Manager: [Holly Borla](https://github.com/hborla)
* Status: **Accepted**
* Implementation: On `main` gated behind `-enable-experimental-feature RegionBasedIsolation`
* Status: **Implemented (Swift 6.0)**
* Upcoming Feature Flag: `RegionBasedIsolation`
* Review: ([first pitch](https://forums.swift.org/t/pitch-safely-sending-non-sendable-values-across-isolation-domains/66566)), ([second pitch](https://forums.swift.org/t/pitch-region-based-isolation/67888)), ([first review](https://forums.swift.org/t/se-0414-region-based-isolation/68805)), ([revision](https://forums.swift.org/t/returned-for-revision-se-0414-region-based-isolation/69123)), ([second review](https://forums.swift.org/t/se-0414-second-review-region-based-isolation/69740)), ([acceptance](https://forums.swift.org/t/accepted-with-modifications-se-0414-region-based-isolation/70051))

## Introduction
Expand Down Expand Up @@ -1722,8 +1722,46 @@ resulting in a race against a write in the closure.

## Source compatibility

This proposal strictly expands the set of acceptable Swift programs, so all
Swift code that was previously accepted by the compiler will still be accepted.
Region-based isolation opens up a new data-race safety hole when using APIs
change the static isolation in the implementation of a `nonisolated` funciton,
such as `assumeIsolated`, because values can become referenced by actor-isolated
state without any indication in the funciton signature:

```swift
class NonSendable {}

@MainActor var globalNonSendable: NonSendable = .init()

nonisolated func stashIntoMainActor(ns: NonSendable) {
MainActor.assumeIsolated {
globalNonSendable = ns
}
}

func stashAndTransfer() -> NonSendable {
let ns = NonSendable()
stashIntoMainActor(ns)
Task.detached {
print(ns)
}
}

@MainActor func transfer() async {
let ns = stashAndTransfer()
await sendSomewhereElse(ns)
}
```

Without additional restrictions, the above code would be valid under this proposal,
but it risks a runtime data-race because the value returned from `stashAndTransfer`
is stored in `MainActor`-isolated state and send to another isolation domain to
be accessed concurrently. To close this hole, values must be sent into and out of
`assumeIsolated`. The base region-isolation rules accomplish this by treating
captures of isolated closures as a region merge, and the standard library annotates
`assumeIsolated` as requiring the result type `T` to conform to `Sendable`. This
impacts existing uses of `assumeIsolated`, so the change is staged in as warnings
under complete concurrency checking, which enables `RegionBasedIsolation` by default,
and an error in Swift 6 mode.

## ABI compatibility

Expand Down
3 changes: 1 addition & 2 deletions proposals/0415-function-body-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* Proposal: [SE-0415](0415-function-body-macros.md)
* Authors: [Doug Gregor](https://github.com/DougGregor)
* Review Manager: [Tony Allevato](https://github.com/allevato)
* Status: **Accepted**
* Implementation: Available on `main` behind the flag `-enable-experimental-feature BodyMacros`
* Status: **Implemented (Swift 6.0)**
* Feature Flag: `BodyMacros`
* Review: [pitch](https://forums.swift.org/t/function-body-macros/66471), [review](https://forums.swift.org/t/se-0415-function-body-macros/68847), [returned for revision](https://forums.swift.org/t/returned-for-revision-se-0415-function-body-macros/69114), [second review](https://forums.swift.org/t/se-0415-second-review-function-body-macros/71644), [acceptance](https://forums.swift.org/t/accepted-se-0415-function-body-macros/72013)

Expand Down
3 changes: 1 addition & 2 deletions proposals/0417-task-executor-preference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* Proposal: [SE-0417](0417-task-executor-preference.md)
* Author: [Konrad 'ktoso' Malawski](https://github.com/ktoso), [John McCall](https://github.com/rjmccall), [Franz Busch](https://github.com/FranzBusch)
* Review Manager: [Doug Gregor](https://github.com/DougGregor)
* Status: **Accepted**
* Implementation: [PR #68793](https://github.com/apple/swift/pull/68793)
* Status: **Implemented (Swift 6.0)**
* Review: ([pitch](https://forums.swift.org/t/pitch-task-executor-preference/68191)), ([review](https://forums.swift.org/t/se-0417-task-executor-preference/68958)), ([acceptance](https://forums.swift.org/t/accepted-se-0417-task-executor-preference/69705))

## Introduction
Expand Down
1 change: 0 additions & 1 deletion proposals/0418-inferring-sendable-for-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Authors: [Angela Laar](https://github.com/angela-laar), [Kavon Farvardin](https://github.com/kavon), [Pavel Yaskevich](https://github.com/xedin)
* Review Manager: [Becca Royal-Gordon](https://github.com/beccadax)
* Status: **Implemented (Swift 6.0)**
* Implementation: [apple/swift#67498](https://github.com/apple/swift/pull/67498), [apple/swift#70076](https://github.com/apple/swift/pull/70076)
* Upcoming Feature Flag: `InferSendableFromCaptures`
* Review: ([pitch](https://forums.swift.org/t/pitch-inferring-sendable-for-methods/66565)) ([review](https://forums.swift.org/t/se-0418-inferring-sendable-for-methods-and-key-path-literals/68999)) ([acceptance](https://forums.swift.org/t/accepted-se-0418-inferring-sendable-for-methods-and-key-path-literals/69242))

Expand Down
1 change: 0 additions & 1 deletion proposals/0420-inheritance-of-actor-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Authors: [John McCall](https://github.com/rjmccall), [Holly Borla](https://github.com/hborla), [Doug Gregor](https://github.com/douggregor)
* Review Manager: [Xiaodi Wu](https://github.com/xwu)
* Status: **Implemented (Swift 6.0)**
* Implementation: [apple/swift#70758](https://github.com/apple/swift/pull/70758), [apple/swift#70902](https://github.com/apple/swift/pull/70902)
* Review: ([pitch](https://forums.swift.org/t/pitch-inheriting-the-callers-actor-isolation/68391)) ([review](https://forums.swift.org/t/se-0420-inheritance-of-actor-isolation/69638)) ([acceptance](https://forums.swift.org/t/accepted-se-0420-inheritance-of-actor-isolation/69913))

[SE-0302]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0302-concurrent-value-and-concurrent-closures.md
Expand Down
1 change: 0 additions & 1 deletion proposals/0421-generalize-async-sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Authors: [Doug Gregor](https://github.com/douggregor), [Holly Borla](https://github.com/hborla)
* Review Manager: [Freddy Kellison-Linn](https://github.com/Jumhyn)
* Status: **Implemented (Swift 6.0)**
* Implementation: https://github.com/apple/swift/pull/70635
* Review: ([pitch](https://forums.swift.org/t/pitch-generalize-asyncsequence-and-asynciteratorprotocol/69283))([review](https://forums.swift.org/t/se-0421-generalize-effect-polymorphism-for-asyncsequence-and-asynciteratorprotocol/69662)) ([acceptance](https://forums.swift.org/t/accepted-se-0421-generalize-effect-polymorphism-for-asyncsequence-and-asynciteratorprotocol/69973))

## Introduction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Authors: [Apollo Zhu](https://github.com/ApolloZhu)
* Review Manager: [Doug Gregor](https://github.com/DougGregor)
* Status: **Implemented (Swift 6.0)**
* Implementation: [PR #70602](https://github.com/apple/swift/pull/70602) with experimental feature flag `ExpressionMacroDefaultArguments`
* Review: ([pitch](https://forums.swift.org/t/pitch-expression-macro-as-caller-side-default-argument/69019)), ([review](https://forums.swift.org/t/se-0422-expression-macro-as-caller-side-default-argument/69730)), ([acceptance](https://forums.swift.org/t/accepted-se-0422-expression-macro-as-caller-side-default-argument/70050))

## Introduction
Expand Down
1 change: 0 additions & 1 deletion proposals/0423-dynamic-actor-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Status: **Implemented (Swift 6.0)**
* Upcoming Feature Flag: `DynamicActorIsolation`
* Review: ([pitch](https://forums.swift.org/t/pitch-dynamic-actor-isolation-enforcement/68354)) ([first review](https://forums.swift.org/t/se-0423-dynamic-actor-isolation-enforcement-from-non-strict-concurrency-contexts/70155)) ([second review](https://forums.swift.org/t/se-0423-second-review-dynamic-actor-isolation-enforcement-from-non-strict-concurrency-contexts/71159)) ([acceptance](https://forums.swift.org/t/accepted-se-0423-dynamic-actor-isolation-enforcement-from-non-strict-concurrency-contexts/71540))
* Implementation: [apple/swift#70867](https://github.com/apple/swift/pull/70867), [apple/swift#71261](https://github.com/apple/swift/pull/71261), [apple/swift-syntax#2419](https://github.com/apple/swift-syntax/pull/2419)

## Introduction

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* Proposal: [SE-0424](0424-custom-isolation-checking-for-serialexecutor.md)
* Author: [Konrad 'ktoso' Malawski](https://github.com/ktoso)
* Review Manager: [John McCall](https://github.com/rjmccall)
* Status: **Accepted**
* Implementation: [apple/swift#71172](https://github.com/apple/swift/pull/71172)
* Status: **Implemented (Swift 6.0)**
* Review: ([pitch](https://forums.swift.org/t/pitch-custom-isolation-checking-for-serialexecutor/69786)) ([review](https://forums.swift.org/t/se-0424-custom-isolation-checking-for-serialexecutor/70195)) ([acceptance](https://forums.swift.org/t/accepted-se-0424-custom-isolation-checking-for-serialexecutor/70480))

## Introduction
Expand Down
3 changes: 1 addition & 2 deletions proposals/0428-resolve-distributed-actor-protocols.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* Proposal: [SE-0428](0428-resolve-distributed-actor-protocols.md)
* Author: [Konrad 'ktoso' Malawski](https://github.com/ktoso), [Pavel Yaskevich](https://github.com/xedin)
* Review Manager: [Freddy Kellison-Linn](https://github.com/Jumhyn)
* Status: **Accepted with revisions**
* Implementation: [PR #70928](https://github.com/apple/swift/pull/70928)
* Status: **Implemented (Swift 6.0)**
* Review: ([pitch](https://forums.swift.org/t/pitch-resolve-distributedactor-protocols-for-server-client-apps/69933)) ([review](https://forums.swift.org/t/se-0428-resolve-distributedactor-protocols/70669)) ([acceptance](https://forums.swift.org/t/accepted-with-modifications-se-0428-resolve-distributedactor-protocols/71366))

## Introduction
Expand Down
3 changes: 1 addition & 2 deletions proposals/0430-transferring-parameters-and-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* Proposal: [SE-0430](0430-transferring-parameters-and-results.md)
* Authors: [Michael Gottesman](https://github.com/gottesmm), [Holly Borla](https://github.com/hborla), [John McCall](https://github.com/rjmccall)
* Review Manager: [Becca Royal-Gordon](https://github.com/beccadax)
* Status: **Accepted with Modifications**
* Implementation: On `main` gated behind `-enable-experimental-feature TransferringArgsAndResults`
* Status: **Implemented (Swift 6.0)**
* Previous Proposal: [SE-0414: Region-based isolation](/proposals/0414-region-based-isolation.md)
* Review: ([pitch](https://forums.swift.org/t/pitch-transferring-isolation-regions-of-parameter-and-result-values/70240)) ([first review](https://forums.swift.org/t/se-0430-transferring-isolation-regions-of-parameter-and-result-values/70830)) ([returned for revision](https://forums.swift.org/t/returned-for-revision-se-0430-transferring-isolation-regions-of-parameter-and-result-values/71297)) ([second review](https://forums.swift.org/t/se-0430-second-review-sendable-parameter-and-result-values/71685)) ([acceptance with modifications](https://forums.swift.org/t/accepted-with-modifications-se-0430-second-review-sendable-parameter-and-result-values/71850))

Expand Down
3 changes: 1 addition & 2 deletions proposals/0431-isolated-any-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* Proposal: [SE-0431](0431-isolated-any-functions.md)
* Authors: [John McCall](https://github.com/rjmccall)
* Review Manager: [Doug Gregor](https://github.com/DougGregor)
* Status: **Accepted**
* Implementation: [apple/swift#71433](https://github.com/apple/swift/pull/71433), [apple/swift#71574](https://github.com/apple/swift/pull/71574), available on `main` with `-enable-experimental-feature IsolatedAny`.
* Status: **Implemented (Swift 6.0)**
* Previous revision: [1](https://github.com/swiftlang/swift-evolution/blob/b35498bf6f198477be50809c0fec3944259e86d0/proposals/0431-isolated-any-functions.md)
* Review: ([pitch](https://forums.swift.org/t/isolated-any-function-types/70562))([review](https://forums.swift.org/t/se-0431-isolated-any-function-types/70939))([acceptance](https://forums.swift.org/t/accepted-with-modifications-se-0431-isolated-any-function-types/71611))

Expand Down
4 changes: 2 additions & 2 deletions proposals/0434-global-actor-isolated-types-usability.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Proposal: [SE-0434](0434-global-actor-isolated-types-usability.md)
* Authors: [Sima Nerush](https://github.com/simanerush), [Matt Massicotte](https://github.com/mattmassicotte), [Holly Borla](https://github.com/hborla)
* Review Manager: [John McCall](https://github.com/rjmccall)
* Status: **Active review (April 10th...22nd, 2024)**
* Implementation: On `main` gated behind `-enable-experimental-feature GlobalActorIsolatedTypesUsability`
* Status: **Implemented (Swift 6.0)**
* Upcoming Feature Flag: `GlobalActorIsolatedTypesUsability`
* Review: ([pitch](https://forums.swift.org/t/pitch-usability-of-global-actor-isolated-types/70799)) ([review](https://forums.swift.org/t/se-0434-usability-of-global-actor-isolated-types/71187))

## Introduction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* Proposal: [SE-0435](0435-swiftpm-per-target-swift-language-version-setting.md)
* Authors: [Pavel Yaskevich](https://github.com/xedin)
* Review Manager: [Becca Royal-Gordon](https://github.com/beccadax)
* Status: **Accepted**
* Implementation: [apple/swift-package-manager#7439](https://github.com/apple/swift-package-manager/pull/7439)
* Status: **Implemented (Swift 6.0)**
* Review: ([pitch](https://forums.swift.org/t/pitch-swiftpm-swift-language-version-per-target/71067)) ([review](https://forums.swift.org/t/se-0435-swift-language-version-per-target/71546)) ([acceptance](https://forums.swift.org/t/accepted-se-0435-swift-language-version-per-target/71846))

## Introduction
Expand Down