Skip to content

Commit 3a56140

Browse files
authored
Mark a bunch of proposals as implemented in Swift 6.0. (#2496)
* Mark a bunch of proposals as implemented in Swift 6.0. * Remove implementation field for implemented proposals. * [SE-0414] Update the source compatibility section per the acceptance notes.
1 parent 064d72d commit 3a56140

14 files changed

+51
-25
lines changed

proposals/0414-region-based-isolation.md

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Proposal: [SE-0414](0414-region-based-isolation.md)
44
* Authors: [Michael Gottesman](https://github.com/gottesmm) [Joshua Turcotti](https://github.com/jturcotti)
55
* Review Manager: [Holly Borla](https://github.com/hborla)
6-
* Status: **Accepted**
7-
* Implementation: On `main` gated behind `-enable-experimental-feature RegionBasedIsolation`
6+
* Status: **Implemented (Swift 6.0)**
7+
* Upcoming Feature Flag: `RegionBasedIsolation`
88
* 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))
99

1010
## Introduction
@@ -1722,8 +1722,46 @@ resulting in a race against a write in the closure.
17221722

17231723
## Source compatibility
17241724

1725-
This proposal strictly expands the set of acceptable Swift programs, so all
1726-
Swift code that was previously accepted by the compiler will still be accepted.
1725+
Region-based isolation opens up a new data-race safety hole when using APIs
1726+
change the static isolation in the implementation of a `nonisolated` funciton,
1727+
such as `assumeIsolated`, because values can become referenced by actor-isolated
1728+
state without any indication in the funciton signature:
1729+
1730+
```swift
1731+
class NonSendable {}
1732+
1733+
@MainActor var globalNonSendable: NonSendable = .init()
1734+
1735+
nonisolated func stashIntoMainActor(ns: NonSendable) {
1736+
MainActor.assumeIsolated {
1737+
globalNonSendable = ns
1738+
}
1739+
}
1740+
1741+
func stashAndTransfer() -> NonSendable {
1742+
let ns = NonSendable()
1743+
stashIntoMainActor(ns)
1744+
Task.detached {
1745+
print(ns)
1746+
}
1747+
}
1748+
1749+
@MainActor func transfer() async {
1750+
let ns = stashAndTransfer()
1751+
await sendSomewhereElse(ns)
1752+
}
1753+
```
1754+
1755+
Without additional restrictions, the above code would be valid under this proposal,
1756+
but it risks a runtime data-race because the value returned from `stashAndTransfer`
1757+
is stored in `MainActor`-isolated state and send to another isolation domain to
1758+
be accessed concurrently. To close this hole, values must be sent into and out of
1759+
`assumeIsolated`. The base region-isolation rules accomplish this by treating
1760+
captures of isolated closures as a region merge, and the standard library annotates
1761+
`assumeIsolated` as requiring the result type `T` to conform to `Sendable`. This
1762+
impacts existing uses of `assumeIsolated`, so the change is staged in as warnings
1763+
under complete concurrency checking, which enables `RegionBasedIsolation` by default,
1764+
and an error in Swift 6 mode.
17271765

17281766
## ABI compatibility
17291767

proposals/0415-function-body-macros.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0415](0415-function-body-macros.md)
44
* Authors: [Doug Gregor](https://github.com/DougGregor)
55
* Review Manager: [Tony Allevato](https://github.com/allevato)
6-
* Status: **Accepted**
7-
* Implementation: Available on `main` behind the flag `-enable-experimental-feature BodyMacros`
6+
* Status: **Implemented (Swift 6.0)**
87
* Feature Flag: `BodyMacros`
98
* 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)
109

proposals/0417-task-executor-preference.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0417](0417-task-executor-preference.md)
44
* Author: [Konrad 'ktoso' Malawski](https://github.com/ktoso), [John McCall](https://github.com/rjmccall), [Franz Busch](https://github.com/FranzBusch)
55
* Review Manager: [Doug Gregor](https://github.com/DougGregor)
6-
* Status: **Accepted**
7-
* Implementation: [PR #68793](https://github.com/apple/swift/pull/68793)
6+
* Status: **Implemented (Swift 6.0)**
87
* 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))
98

109
## Introduction

proposals/0418-inferring-sendable-for-methods.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Authors: [Angela Laar](https://github.com/angela-laar), [Kavon Farvardin](https://github.com/kavon), [Pavel Yaskevich](https://github.com/xedin)
55
* Review Manager: [Becca Royal-Gordon](https://github.com/beccadax)
66
* Status: **Implemented (Swift 6.0)**
7-
* Implementation: [apple/swift#67498](https://github.com/apple/swift/pull/67498), [apple/swift#70076](https://github.com/apple/swift/pull/70076)
87
* Upcoming Feature Flag: `InferSendableFromCaptures`
98
* 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))
109

proposals/0420-inheritance-of-actor-isolation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Authors: [John McCall](https://github.com/rjmccall), [Holly Borla](https://github.com/hborla), [Doug Gregor](https://github.com/douggregor)
55
* Review Manager: [Xiaodi Wu](https://github.com/xwu)
66
* Status: **Implemented (Swift 6.0)**
7-
* Implementation: [apple/swift#70758](https://github.com/apple/swift/pull/70758), [apple/swift#70902](https://github.com/apple/swift/pull/70902)
87
* 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))
98

109
[SE-0302]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0302-concurrent-value-and-concurrent-closures.md

proposals/0421-generalize-async-sequence.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Authors: [Doug Gregor](https://github.com/douggregor), [Holly Borla](https://github.com/hborla)
55
* Review Manager: [Freddy Kellison-Linn](https://github.com/Jumhyn)
66
* Status: **Implemented (Swift 6.0)**
7-
* Implementation: https://github.com/apple/swift/pull/70635
87
* 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))
98

109
## Introduction

proposals/0422-caller-side-default-argument-macro-expression.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Authors: [Apollo Zhu](https://github.com/ApolloZhu)
55
* Review Manager: [Doug Gregor](https://github.com/DougGregor)
66
* Status: **Implemented (Swift 6.0)**
7-
* Implementation: [PR #70602](https://github.com/apple/swift/pull/70602) with experimental feature flag `ExpressionMacroDefaultArguments`
87
* 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))
98

109
## Introduction

proposals/0423-dynamic-actor-isolation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* Status: **Implemented (Swift 6.0)**
77
* Upcoming Feature Flag: `DynamicActorIsolation`
88
* 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))
9-
* 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)
109

1110
## Introduction
1211

proposals/0424-custom-isolation-checking-for-serialexecutor.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0424](0424-custom-isolation-checking-for-serialexecutor.md)
44
* Author: [Konrad 'ktoso' Malawski](https://github.com/ktoso)
55
* Review Manager: [John McCall](https://github.com/rjmccall)
6-
* Status: **Accepted**
7-
* Implementation: [apple/swift#71172](https://github.com/apple/swift/pull/71172)
6+
* Status: **Implemented (Swift 6.0)**
87
* 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))
98

109
## Introduction

proposals/0428-resolve-distributed-actor-protocols.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0428](0428-resolve-distributed-actor-protocols.md)
44
* Author: [Konrad 'ktoso' Malawski](https://github.com/ktoso), [Pavel Yaskevich](https://github.com/xedin)
55
* Review Manager: [Freddy Kellison-Linn](https://github.com/Jumhyn)
6-
* Status: **Accepted with revisions**
7-
* Implementation: [PR #70928](https://github.com/apple/swift/pull/70928)
6+
* Status: **Implemented (Swift 6.0)**
87
* 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))
98

109
## Introduction

proposals/0430-transferring-parameters-and-results.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0430](0430-transferring-parameters-and-results.md)
44
* Authors: [Michael Gottesman](https://github.com/gottesmm), [Holly Borla](https://github.com/hborla), [John McCall](https://github.com/rjmccall)
55
* Review Manager: [Becca Royal-Gordon](https://github.com/beccadax)
6-
* Status: **Accepted with Modifications**
7-
* Implementation: On `main` gated behind `-enable-experimental-feature TransferringArgsAndResults`
6+
* Status: **Implemented (Swift 6.0)**
87
* Previous Proposal: [SE-0414: Region-based isolation](/proposals/0414-region-based-isolation.md)
98
* 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))
109

proposals/0431-isolated-any-functions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0431](0431-isolated-any-functions.md)
44
* Authors: [John McCall](https://github.com/rjmccall)
55
* Review Manager: [Doug Gregor](https://github.com/DougGregor)
6-
* Status: **Accepted**
7-
* 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`.
6+
* Status: **Implemented (Swift 6.0)**
87
* Previous revision: [1](https://github.com/swiftlang/swift-evolution/blob/b35498bf6f198477be50809c0fec3944259e86d0/proposals/0431-isolated-any-functions.md)
98
* 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))
109

proposals/0434-global-actor-isolated-types-usability.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Proposal: [SE-0434](0434-global-actor-isolated-types-usability.md)
44
* Authors: [Sima Nerush](https://github.com/simanerush), [Matt Massicotte](https://github.com/mattmassicotte), [Holly Borla](https://github.com/hborla)
55
* Review Manager: [John McCall](https://github.com/rjmccall)
6-
* Status: **Active review (April 10th...22nd, 2024)**
7-
* Implementation: On `main` gated behind `-enable-experimental-feature GlobalActorIsolatedTypesUsability`
6+
* Status: **Implemented (Swift 6.0)**
7+
* Upcoming Feature Flag: `GlobalActorIsolatedTypesUsability`
88
* 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))
99

1010
## Introduction

proposals/0435-swiftpm-per-target-swift-language-version-setting.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Proposal: [SE-0435](0435-swiftpm-per-target-swift-language-version-setting.md)
44
* Authors: [Pavel Yaskevich](https://github.com/xedin)
55
* Review Manager: [Becca Royal-Gordon](https://github.com/beccadax)
6-
* Status: **Accepted**
7-
* Implementation: [apple/swift-package-manager#7439](https://github.com/apple/swift-package-manager/pull/7439)
6+
* Status: **Implemented (Swift 6.0)**
87
* 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))
98

109
## Introduction

0 commit comments

Comments
 (0)