Skip to content

Commit 09e5dd0

Browse files
committed
Merge branch 'main' into mutablespan
2 parents b15d39a + a0e7cf5 commit 09e5dd0

25 files changed

+5829
-214
lines changed

process.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Please state explicitly whether you believe that the proposal should be accepted
111111
Proposals that can ship as part of the [Standard Library Preview package][preview-package]
112112
should be paired with a pull request against the [swift-evolution-staging repository][swift-evolution-staging].
113113
All other proposals should be paired with an implementation pull request
114-
against the [main Swift repository](https://github.com/apple/swift).
114+
against the [main Swift repository](https://github.com/swiftlang/swift).
115115

116116
The preview package can accept new types, new protocols, and extensions to
117117
existing types and protocols that can be implemented without access to
@@ -162,13 +162,13 @@ flowchart LR
162162
%% <https://mermaid-js.github.io/>
163163
164164
%% Nodes:
165-
1{{"Awaiting\nreview"}}
166-
2{{"Scheduled\nfor review"}}
167-
3{"Active\nreview"}
168-
4["Returned\nfor revision"]
165+
1{{"Awaiting<br/>review"}}
166+
2{{"Scheduled<br>for review"}}
167+
3{"Active<br/>review"}
168+
4["Returned<br/>for revision"]
169169
5(["Withdrawn"])
170170
6(["Rejected"])
171-
7_8["Accepted\n(with revisions)"]
171+
7_8["Accepted<br/>(with revisions)"]
172172
9[["Previewing"]]
173173
10(["Implemented"])
174174
@@ -208,7 +208,7 @@ A given proposal can be in one of several states:
208208
[swift-evolution-repo]: https://github.com/swiftlang/swift-evolution "Swift evolution repository"
209209
[swift-evolution-staging]: https://github.com/swiftlang/swift-evolution-staging "Swift evolution staging repository"
210210
[proposal-reviews]: https://forums.swift.org/c/evolution/proposal-reviews "'Proposal reviews' category of the Swift forums"
211-
[status-page]: https://apple.github.io/swift-evolution/
211+
[status-page]: https://www.swift.org/swift-evolution
212212
[preview-package]: https://github.com/apple/swift-standard-library-preview/
213213
[language-steering-group]: https://www.swift.org/language-steering-group
214214

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Swift Testing Feature name
2+
3+
* Proposal: [ST-NNNN](NNNN-filename.md)
4+
* Authors: [Author 1](https://github.com/author1), [Author 2](https://github.com/author2)
5+
* Status: **Awaiting implementation** or **Awaiting review**
6+
* Bug: _if applicable_ [swiftlang/swift-testing#NNNNN](https://github.com/swiftlang/swift-testing/issues/NNNNN)
7+
* Implementation: [swiftlang/swift-testing#NNNNN](https://github.com/swiftlang/swift-testing/pull/NNNNN)
8+
* Previous Proposal: _if applicable_ [ST-XXXX](XXXX-filename.md)
9+
* Previous Revision: _if applicable_ [1](https://github.com/swiftlang/swift-evolution/blob/...commit-ID.../proposals/testing/NNNN-filename.md)
10+
* Review: ([pitch](https://forums.swift.org/...))
11+
12+
When filling out this template, you should delete or replace all of the text
13+
except for the section headers and the header fields above. For example, you
14+
should delete everything from this paragraph down to the Introduction section
15+
below.
16+
17+
As a proposal author, you should fill out all of the header fields. Delete any
18+
header fields marked _if applicable_ that are not applicable to your proposal.
19+
20+
When sharing a link to the proposal while it is still a PR, be sure to share a
21+
live link to the proposal, not an exact commit, so that readers will always see
22+
the latest version when you make changes. On GitHub, you can find this link by
23+
browsing the PR branch: from the PR page, click the "username wants to merge ...
24+
from username:my-branch-name" link and find the proposal file in that branch.
25+
26+
`Status` should reflect the current implementation status while the proposal is
27+
still a PR. The proposal cannot be reviewed until an implementation is available,
28+
but early readers should see the correct status.
29+
30+
`Bug` should be used when this proposal is fixing a bug with significant
31+
discussion in the bug report. It is not necessary to link bugs that do not
32+
contain significant discussion or that merely duplicate discussion linked
33+
somewhere else. Do not link bugs from private bug trackers.
34+
35+
`Implementation` should link to the PR(s) implementing the feature. If the
36+
proposal has not been implemented yet, or if it simply codifies existing
37+
behavior, just say that. If the implementation has already been committed to the
38+
main branch (as an experimental feature or SPI), mention that. If the
39+
implementation is spread across multiple PRs, just link to the most important
40+
ones.
41+
42+
`Previous Proposal` should be used when there is a specific line of succession
43+
between this proposal and another proposal. For example, this proposal might
44+
have been removed from a previous proposal so that it can be reviewed separately,
45+
or this proposal might supersede a previous proposal in some way that was felt
46+
to exceed the scope of a "revision". Include text briefly explaining the
47+
relationship, such as "Supersedes ST-1234" or "Extracted from ST-01234". If
48+
possible, link to a post explaining the relationship, such as a review decision
49+
that asked for part of the proposal to be split off. Otherwise, you can just
50+
link to the previous proposal.
51+
52+
`Previous Revision` should be added after a major substantive revision of a
53+
proposal that has undergone review. It links to the previously reviewed revision.
54+
It is not necessary to add or update this field after minor editorial changes.
55+
56+
`Review` is a history of all discussion threads about this proposal, in
57+
chronological order. Use these standardized link names: `pitch` `review`
58+
`revision` `acceptance` `rejection`. If there are multiple such threads, spell
59+
the ordinal out: `first pitch` `second review` etc.
60+
61+
## Introduction
62+
63+
A short description of what the feature is. Try to keep it to a single-paragraph
64+
"elevator pitch" so the reader understands what problem this proposal is
65+
addressing.
66+
67+
## Motivation
68+
69+
Describe the problems that this proposal seeks to address. If the problem is
70+
that some common pattern is currently hard to express, show how one can
71+
currently get a similar effect and describe its drawbacks. If it's completely
72+
new functionality that cannot be emulated, motivate why this new functionality
73+
would help Swift developers test their code more effectively.
74+
75+
## Proposed solution
76+
77+
Describe your solution to the problem. Provide examples and describe how they
78+
work. Show how your solution is better than current workarounds: is it cleaner,
79+
safer, or more efficient?
80+
81+
This section doesn't have to be comprehensive. Focus on the most important parts
82+
of the proposal and make arguments about why the proposal is better than the
83+
status quo.
84+
85+
## Detailed design
86+
87+
Describe the design of the solution in detail. If it includes new API, show the
88+
full API and its documentation comments detailing what it does. If it involves
89+
new macro logic, describe the behavior changes and include a succinct example of
90+
the additions or modifications to the macro expansion code. The detail in this
91+
section should be sufficient for someone who is *not* one of the authors to be
92+
able to reasonably implement the feature.
93+
94+
## Source compatibility
95+
96+
Describe the impact of this proposal on source compatibility. As a general rule,
97+
all else being equal, test code that worked in previous releases of the testing
98+
library should work in new releases. That means both that it should continue to
99+
build and that it should continue to behave dynamically the same as it did
100+
before.
101+
102+
This is not an absolute guarantee, and the testing library administrators will
103+
consider intentional compatibility breaks if their negative impact can be shown
104+
to be small and the current behavior is causing substantial problems in practice.
105+
106+
For proposals that affect testing library API, consider the impact on existing
107+
clients. If clients provide a similar API, will type-checking find the right one?
108+
If the feature overloads an existing API, is it problematic that existing users
109+
of that API might start resolving to the new API?
110+
111+
## Integration with supporting tools
112+
113+
In this section, describe how this proposal affects tools which integrate with
114+
the testing library. Some features depend on supporting tools gaining awareness
115+
of the new feature for users to realize new benefits. Other features do not
116+
strictly require integration but bring improvement opportunities which are worth
117+
considering. Use this section to discuss any impact on tools.
118+
119+
This section does need not to include details of how this proposal may be
120+
integrated with _specific_ tools, but it should consider the general ways that
121+
tools might support this feature and note any accompanying SPI intended for
122+
tools which are included in the implementation. Note that tools may evolve
123+
independently and have differing release schedules than the testing library, so
124+
special care should be taken to ensure compatibility across versions according
125+
to the needs of each tool.
126+
127+
## Future directions
128+
129+
Describe any interesting proposals that could build on this proposal in the
130+
future. This is especially important when these future directions inform the
131+
design of the proposal, for example by making sure an interface meant for tools
132+
integration can be extended to include additional information.
133+
134+
The rest of the proposal should generally not talk about future directions
135+
except by referring to this section. It is important not to confuse reviewers
136+
about what is covered by this specific proposal. If there's a larger vision that
137+
needs to be explained in order to understand this proposal, consider starting a
138+
discussion thread on the forums to capture your broader thoughts.
139+
140+
Avoid making affirmative statements in this section, such as "we will" or even
141+
"we should". Describe the proposals neutrally as possibilities to be considered
142+
in the future.
143+
144+
Consider whether any of these future directions should really just be part of
145+
the current proposal. It's important to make focused, self-contained proposals
146+
that can be incrementally implemented and reviewed, but it's also good when
147+
proposals feel "complete" rather than leaving significant gaps in their design.
148+
An an example from the Swift project, when
149+
[SE-0193](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0193-cross-module-inlining-and-specialization.md)
150+
introduced the `@inlinable` attribute, it also included the `@usableFromInline`
151+
attribute so that declarations used in inlinable functions didn't have to be
152+
`public`. This was a relatively small addition to the proposal which avoided
153+
creating a serious usability problem for many adopters of `@inlinable`.
154+
155+
## Alternatives considered
156+
157+
Describe alternative approaches to addressing the same problem. This is an
158+
important part of most proposal documents. Reviewers are often familiar with
159+
other approaches prior to review and may have reasons to prefer them. This
160+
section is your first opportunity to try to convince them that your approach is
161+
the right one, and even if you don't fully succeed, you can help set the terms
162+
of the conversation and make the review a much more productive exchange of ideas.
163+
164+
You should be fair about other proposals, but you do not have to be neutral;
165+
after all, you are specifically proposing something else. Describe any
166+
advantages these alternatives might have, but also be sure to explain the
167+
disadvantages that led you to prefer the approach in this proposal.
168+
169+
You should update this section during the pitch phase to discuss any
170+
particularly interesting alternatives raised by the community. You do not need
171+
to list every idea raised during the pitch, just the ones you think raise points
172+
that are worth discussing. Of course, if you decide the alternative is more
173+
compelling than what's in the current proposal, you should change the main
174+
proposal; be sure to then discuss your previous proposal in this section and
175+
explain why the new idea is better.
176+
177+
## Acknowledgments
178+
179+
If significant changes or improvements suggested by members of the community
180+
were incorporated into the proposal as it developed, take a moment here to thank
181+
them for their contributions. This is a collaborative process, and everyone's
182+
input should receive recognition!
183+
184+
Generally, you should not acknowledge anyone who is listed as a co-author.

proposals/0335-existential-any.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Despite these significant and often undesirable implications, existential types
6262

6363
## Proposed solution
6464

65-
I propose to make existential types syntactically explicit in the language using the `any` keyword. This proposal introduces the new syntax in the Swift 5 language mode, and this syntax should be required for existential types under the Swift 6 language mode.
65+
I propose to make existential types syntactically explicit in the language using the `any` keyword. This proposal introduces the new syntax in the Swift 5 language mode, and this syntax should be required for existential types under a future language mode.
6666

6767
In Swift 5, anywhere that an existential type can be used today, the `any` keyword can be used to explicitly denote an existential type:
6868

@@ -80,10 +80,10 @@ let pq1: P & Q = S() // 'P & Q' in this context is an existential type
8080
let pq2: any P & Q = S() // 'any P & Q' is an explicit existential type
8181
```
8282

83-
In Swift 6, existential types are required be explicitly spelled with `any`:
83+
In a future language mode, existential types are required to be explicitly spelled with `any`:
8484

8585
```swift
86-
// Swift 6 mode
86+
// Future language mode
8787

8888
protocol P {}
8989
protocol Q {}
@@ -96,7 +96,7 @@ let pq1: P & Q = S() // error
9696
let pq2: any P & Q = S() // okay
9797
```
9898

99-
The Swift 6 behavior can be enabled in earlier language modes with the [upcoming feature flag](0362-piecemeal-future-features.md) `ExistentialAny`.
99+
This behavior can be enabled in earlier language modes with the [upcoming feature flag](0362-piecemeal-future-features.md) `ExistentialAny`.
100100

101101
## Detailed design
102102

@@ -192,11 +192,9 @@ func generic<T: AnotherP>(value: T) { ... }
192192
func generic<T: AnyP>(value: T) { ... } // error
193193
```
194194

195-
Once the `any` spelling is required under the Swift 6 language mode, a type alias to a plain protocol name is not a valid type witness for an associated type requirement; existential type witnesses must be explicit in the `typealias` with `any`:
195+
Once the `any` spelling is required under a future language mode, a type alias to a plain protocol name is not a valid type witness for an associated type requirement; existential type witnesses must be explicit in the `typealias` with `any`:
196196

197197
```swift
198-
// Swift 6 code
199-
200198
protocol P {}
201199

202200
protocol Requirements {
@@ -214,16 +212,16 @@ struct S2: Requirements {
214212

215213
## Source compatibility
216214

217-
Enforcing that existential types use the `any` keyword will require a source change. To ease the migration, I propose to start allowing existential types to be spelled with `any` with the Swift 5.6 compiler, and require existential types to be spelled with `any` under the Swift 6 language mode. The old existential type syntax will continue to be supported under the Swift 5 language mode, and the transition to the new syntax is mechanical, so it can be performed automatically by a migrator.
215+
Enforcing that existential types use the `any` keyword will require a source change. To ease the migration, I propose to start allowing existential types to be spelled with `any` with the Swift 5.6 compiler, and require existential types to be spelled with `any` under a future language mode. The old existential type syntax will continue to be supported under the Swift 5 language mode, and the transition to the new syntax is mechanical, so it can be performed automatically by a migrator.
218216

219-
[SE-0309 Unlock existentials for all protocols](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0309-unlock-existential-types-for-all-protocols.md) enables more code to be written using existential types. To minimize the amount of new code written that will become invalid in Swift 6, I propose requiring `any` immediately for protocols with `Self` and associated type requirements. This introduces an inconsistency for protocols under the Swift 5 language mode, but this inconsistency already exists today (because you cannot use certain protocols as existential types at all), and the syntax difference serves two purposes:
217+
[SE-0309 Unlock existentials for all protocols](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0309-unlock-existential-types-for-all-protocols.md) enables more code to be written using existential types. To minimize the amount of new code written that will become invalid under `ExistentialAny`, I propose requiring `any` immediately for protocols with `Self` and associated type requirements. This introduces an inconsistency for protocols under the Swift 5 language mode, but this inconsistency already exists today (because you cannot use certain protocols as existential types at all), and the syntax difference serves two purposes:
220218

221219
1. It saves programmers time in the long run by preventing them from writing new code that will become invalid later.
222-
2. It communicates the existence of `any` and encourages programmers to start using it for other existential types before adopting Swift 6.
220+
2. It communicates the existence of `any` and encourages programmers to start using it for other existential types before adopting `ExistentialAny`.
223221

224-
### Transitioning to `any` in Swift 6
222+
### Transitioning to `any`
225223

226-
The new `any` syntax will be staged in over several major Swift releases. In the release where `any` is introduced, the compiler will not emit any warnings for the lack of `any` on existential types. After `any` is introduced, warnings will be added to guide programmers toward the new syntax. Finally, these warnings can become errors, or [plain protocol names can be repurposed](#re-purposing-the-plain-protocol-name), in Swift 6.
224+
The new `any` syntax will be staged in over several major Swift releases. In the release where `any` is introduced, the compiler will not emit diagnostics for the lack of `any` on existential types, save for the aforementioned cases. After `any` is introduced, warnings will be added to guide programmers toward the new syntax. Finally, a missing `any` will become an unconditional error, or [plain protocol names may be repurposed](#re-purposing-the-plain-protocol-name)in Swift 6 or a later language mode.
227225

228226
## Effect on ABI stability
229227

proposals/0371-isolated-synchronous-deinit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Proposal: [SE-0371](0371-isolated-synchronous-deinit.md)
44
* Author: [Mykola Pokhylets](https://github.com/nickolas-pohilets)
55
* Review Manager: [Frederick Kellison-Linn](https://github.com/jumhyn)
6-
* Status: **Implemented (Swift 6.1)**
6+
* Status: **Implemented (Swift 6.2)**
77
* Implementation: [apple/swift#60057](https://github.com/apple/swift/pull/60057)
88
* Review: ([first pitch](https://forums.swift.org/t/isolated-synchronous-deinit/58177)) ([first review](https://forums.swift.org/t/se-0371-isolated-synchronous-deinit/59754)) ([returned for revision](https://forums.swift.org/t/returned-for-revision-se-0371-isolated-synchronous-deinit/60060)) ([discussion](https://forums.swift.org/t/isolated-synchronous-deinit-2/62565)) ([second pitch](https://forums.swift.org/t/pitch-2-se-0371-isolated-async-deinit/64836)) ([sub-pitch](https://forums.swift.org/t/sub-pitch-task-local-values-in-isolated-synchronous-deinit-and-async-deinit/70060)) ([second review](https://forums.swift.org/t/second-review-se-0371-isolated-synchronous-deinit/73406)) ([accepted with modifications](https://forums.swift.org/t/accepted-with-modifications-se-0371-isolated-synchronous-deinit/74042))
99

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,18 +390,12 @@ the callee. Unlike `consuming` parameters, `sending` parameters do not
390390
have no-implicit-copying semantics.
391391

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

396395
```swift
397396
func sendingConsuming(_ x: consuming sending T) { ... }
398-
func sendingBorrowing(_ x: borrowing sending T) { ... }
399397
```
400398

401-
Note that an explicit `borrowing` annotation always implies no-implicit-copying,
402-
so there is no way to change the default ownership convention of a
403-
`sending` parameter without also opting into no-implicit-copying semantics.
404-
405399
### Adoption in the Concurrency library
406400

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

0 commit comments

Comments
 (0)