Skip to content

Commit 3e2d614

Browse files
authored
Merge branch 'main' into disable-property-wrapper-based-isolation
2 parents 738c89b + 1a7f342 commit 3e2d614

File tree

2,787 files changed

+182165
-109200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,787 files changed

+182165
-109200
lines changed

.github/CODEOWNERS

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
# include
5252
/include/swift/AST/ @hborla @slavapestov @xedin
53+
/include/swift/AST/*Availability* @tshortli
5354
/include/swift/AST/*Conformance* @slavapestov
5455
/include/swift/AST/*Distributed* @ktoso
5556
/include/swift/AST/*Generic* @hborla @slavapestov
@@ -61,18 +62,25 @@
6162
/include/swift/DependencyScan @artemcm
6263
/include/swift/Driver @artemcm
6364
# TODO: /include/swift/IRGen/
65+
/include/swift/IDE/ @ahoppen @bnbarham @rintaro
66+
/include/swift/Index/ @bnbarham
67+
/include/swift/Refactoring @ahoppen @bnbarham
6468
/include/swift/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
6569
/include/swift/PrintAsClang @zoecarver @hyp @egorzhdan
6670
# TODO: /include/swift/SIL/
6771
# TODO: /include/swift/SILOptimizer/
72+
/include/swift/SIL/SILDebug* @adrian-prantl
6873
/include/swift/SILOptimizer/Utils/Distributed* @ktoso
6974
/include/swift/Sema/ @hborla @slavapestov @xedin
7075
/include/swift/Sema/CS* @hborla @xedin
7176
/include/swift/Sema/Constraint* @hborla @xedin
77+
/include/swift/SymbolGraphGen/ @QuietMisdreavus
7278
/include/swift/Threading @al45tair
7379

7480
# lib
7581
/lib/AST/ @hborla @slavapestov @xedin
82+
/lib/AST/*Availability* @tshortli
83+
/lib/AST/ASTPrinter.cpp @hborla @slavapestov @xedin @tshortli
7684
/lib/AST/*Conformance* @slavapestov
7785
/lib/AST/*Generic* @hborla @slavapestov
7886
/lib/AST/*Requirement* @hborla @slavapestov
@@ -83,19 +91,29 @@
8391
/lib/ASTGen/ @zoecarver @CodaFi
8492
/lib/Basic/Windows @compnerd
8593
/lib/ClangImporter @zoecarver @hyp @egorzhdan
94+
/lib/ClangImporter/DWARFImporter* @adrian-prantl
8695
/lib/DependencyScan @artemcm
8796
/lib/Driver @artemcm
88-
/lib/Frontend/ModuleInterfaceLoader.cpp @artemcm
97+
/lib/DriverTool/swift_symbolgraph_extract_main.cpp @QuietMisdreavus
98+
/lib/Frontend/*ModuleInterface* @artemcm @tshortli
8999
# TODO: /lib/IRGen/
100+
/lib/IDE/ @ahoppen @bnbarham @rintaro
101+
/lib/IDETool/ @ahoppen @bnbarham @rintaro
102+
/lib/Index/ @bnbarham
103+
/lib/Refactoring/ @ahoppen @bnbarham
104+
/lib/IRGen/*Debug* @adrian-prantl
90105
/lib/IRGen/*Distributed* @ktoso
91106
/lib/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
92107
/lib/PrintAsClang @zoecarver @hyp @egorzhdan
93108
# TODO: /lib/SIL/
109+
/lib/SIL/IR/SILDebug* @adrian-prantl
110+
/lib/SIL/IR/SILLocation* @adrian-prantl
94111
# TODO: /lib/SILGen/
95112
/lib/SILGen/*Distributed* @ktoso
96113
# TODO: /lib/SILOptimizer/
97114
/lib/SILOptimizer/Utils/Distributed* @ktoso
98115
/lib/Sema/ @hborla @slavapestov @xedin
116+
/lib/Sema/*Availability* @tshortli
99117
/lib/Sema/CS* @hborla @xedin
100118
/lib/Sema/CodeSynthesisDistributed* @hborla @ktoso
101119
/lib/Sema/Constraint* @hborla @xedin
@@ -105,31 +123,40 @@
105123
/lib/Sema/TypeCheckProtocol* @AnthonyLatsis @hborla @slavapestov
106124
/lib/Sema/TypeCheckType* @AnthonyLatsis @hborla @slavapestov @xedin
107125
/lib/Serialization/SerializedModuleLoader.cpp @artemcm
126+
/lib/SymbolGraphGen @QuietMisdreavus
108127
/lib/Threading @al45tair
109128

110129
# localization
111130
# TODO: /localization
112131

113132
# stdlib
114133
# TODO: /stdlib/
134+
/stdlib/public/Backtracing/ @al45tair
115135
/stdlib/public/Cxx/ @zoecarver @hyp @egorzhdan
116136
/stdlib/public/Distributed/ @ktoso
117137
/stdlib/public/Windows/ @compnerd
138+
/stdlib/public/libexec/swift-backtrace/ @al45tair
118139

119140
# test
120141
/test/ASTGen/ @zoecarver @CodaFi
121142
/test/Constraints/ @hborla @xedin
143+
/test/DebugInfo/ @adrian-prantl
122144
/test/Distributed/ @ktoso
123145
/test/Driver/ @artemcm
124146
/test/Generics/ @hborla @slavapestov
125147
# TODO: /test/IRGen/
148+
/test/IDE/ @ahoppen @bnbarham @rintaro
149+
/test/Index/ @bnbarham
150+
/test/refactoring/ @ahoppen @bnbarham
151+
/test/SourceKit/ @ahoppen @bnbarham @rintaro
126152
/test/Interop/ @zoecarver @hyp @egorzhdan
127153
/test/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
128154
# TODO: /test/SIL/
129155
# TODO: /test/SILGen/
130156
# TODO: /test/SILOptimizer/
131157
/test/ScanDependencies/ @artemcm
132158
/test/Sema/ @hborla @slavapestov @xedin
159+
/test/SymbolGraph/ @QuietMisdreavus
133160
/test/decl/ @hborla @slavapestov
134161
/test/decl/protocol/ @AnthonyLatsis @hborla @slavapestov
135162
# FIXME: This file could have a dedicated directory.
@@ -141,25 +168,39 @@
141168

142169
# tools
143170
# TODO: /tools
171+
/tools/SourceKit @ahoppen @bnbarham @rintaro
172+
/tools/lldb-moduleimport-test/ @adrian-prantl
173+
/tools/swift-ide-test @ahoppen @bnbarham @rintaro
174+
/tools/swift-refactor @ahoppen @bnbarham
144175

145176
# unittests
146177
/unittests/AST/ @hborla @slavapestov @xedin
147178
/unittests/AST/*Evaluator* @CodaFi @slavapestov
148179
/unittests/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
149180
# TODO: /unittests/SIL/
150181
/unittests/Sema/ @hborla @xedin
182+
/unittests/SourceKit/ @ahoppen @bnbarham @rintaro
151183
# TODO: /unittests/stdlib/
152184

153185
# userdocs
154186
# TODO: /userdocs
155187

156188
# utils
157-
/utils/*windows* @compnerd
158-
/utils/update-checkout* @shahmishal
159-
/utils/update_checkout/ @shahmishal
189+
/utils/*windows* @compnerd
190+
/utils/gyb_sourcekit_support/ @ahoppen @bnbarham @rintaro
191+
/utils/sourcekit_fuzzer/ @ahoppen @bnbarham @rintaro
192+
/utils/swift_build_support/products/earlyswiftsyntax.py @ahoppen @bnbarham
193+
/utils/swift_build_support/products/skstresstester.py @ahoppen @bnbarham
194+
/utils/swift_build_support/products/sourcekitlsp.py @ahoppen @bnbarham
195+
/utils/swift_build_support/products/swiftevolve.py @ahoppen @bnbarham
196+
/utils/swift_build_support/products/swiftformat.py @ahoppen @allevato @bnbarham
197+
/utils/swift_build_support/products/swiftsyntax.py @ahoppen @bnbarham
198+
/utils/update-checkout* @shahmishal
199+
/utils/update_checkout/ @shahmishal
160200

161201
# validation-test
162202
# TODO: /validation-test/IRGen/
203+
/validation-test/IDE/ @ahoppen @bnbarham @rintaro
163204
/validation-test/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
164205
# TODO: /validation-test/SIL/
165206
# TODO: /validation-test/SILGen/

CHANGELOG.md

Lines changed: 120 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,100 @@
11
# CHANGELOG
22

3-
_**Note:** This is in reverse chronological order, so newer entries are added to the top._
3+
> **Note**\
4+
> This is in reverse chronological order, so newer entries are added to the top.
5+
6+
## Swift 5.9
7+
8+
* [#64927][]:
9+
10+
Swift 5.9 introduces warnings that catch conversions from an inout
11+
argument in the caller to an `UnsafeRawPointer` in the callee
12+
whenever the original type contains an object reference.
13+
14+
```swift
15+
func inspectString(string: inout String) {
16+
readBytes(&string)
17+
// warning: forming an 'UnsafeRawPointer' to an inout variable of type String
18+
// exposes the internal representation rather than the string contents.
19+
}
20+
```
21+
22+
```swift
23+
func inspectData(data: inout Data) {
24+
readBytes(&data)
25+
// warning: forming an 'UnsafeRawPointer' to a variable of type 'T';
26+
// this is likely incorrect because 'T' may contain an object reference.
27+
}
28+
```
29+
30+
Please see the "Workarounds for common cases" section link in github
31+
issue #64927.
32+
33+
* Marking stored properties as unavailable with `@available` has been banned,
34+
closing an unintentional soundness hole that had allowed arbitrary
35+
unavailable code to run and unavailable type metadata to be used at runtime:
36+
37+
```swift
38+
@available(*, unavailable)
39+
struct Unavailable {
40+
init() {
41+
print("Unavailable.init()")
42+
}
43+
}
44+
45+
struct S {
46+
@available(*, unavailable)
47+
var x = Unavailable()
48+
}
49+
50+
_ = S() // prints "Unavailable.init()"
51+
```
52+
53+
Marking `deinit` as unavailable has also been banned for similar reasons.
54+
55+
* [SE-0366][]:
56+
57+
The lifetime of a local variable value can be explicitly ended using the
58+
`consume` operator, forwarding ownership to the surrounding call, assignment,
59+
or initialization without copying:
60+
61+
```swift
62+
var x: [String] = []
63+
x.append("apples")
64+
x.append("bananas")
65+
x.append("oranges")
66+
67+
process(consume x) // forward the current value, without copying
68+
69+
x = [] // start building a new value
70+
x.append("broccoli")
71+
x.append("cauliflower")
72+
x.append("asparagus")
73+
...
74+
```
75+
76+
* [SE-0377][]:
77+
78+
Functions can now declare whether they take value parameters by `borrowing`
79+
access to a value provided by the caller, or by `consuming` a value that the
80+
callee is allowed to take ownership of:
81+
82+
```swift
83+
struct HealthyFoods {
84+
var values: [String] = []
85+
86+
// Ask to `consume` the parameter, since we want to use it
87+
// to incorporate into our own `values` array
88+
mutating func add(_ value: consuming String) {
89+
values.append(value)
90+
}
91+
}
92+
```
493

594
## Swift 5.8
695

96+
### 2023-03-30 (Xcode 14.3)
97+
798
* [SE-0376][]:
899

9100
The `@backDeployed(before:)` attribute may now be used to extend the availability of a function to OS releases prior to the introduction of that function as ABI.
@@ -228,10 +319,10 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
228319
New types representing time and clocks were introduced. This includes a protocol `Clock` defining clocks which allow for defining a concept of now and a way to wake up after a given instant. Additionally a new protocol `InstantProtocol` for defining instants in time was added. Furthermore a new protocol `DurationProtocol` was added to define an elapsed duration between two given `InstantProtocol` types. Most commonly the `Clock` types for general use are the `SuspendingClock` and `ContinuousClock` which represent the most fundamental clocks for the system. The `SuspendingClock` type does not progress while the machine is suspended whereas the `ContinuousClock` progresses no matter the state of the machine.
229320

230321
```swift
231-
func delayedHello() async throws {
232-
try await Task.sleep(until: .now + .milliseconds(123), clock: .continuous)
233-
print("hello delayed world")
234-
}
322+
func delayedHello() async throws {
323+
try await Task.sleep(until: .now + .milliseconds(123), clock: .continuous)
324+
print("hello delayed world")
325+
}
235326
```
236327

237328
`Clock` also has methods to measure the elapsed duration of the execution of work. In the case of the `SuspendingClock` and `ContinuousClock` this measures with high resolution and is suitable for benchmarks.
@@ -253,17 +344,17 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
253344
`any` type having the same constraints as the associated type. For example:
254345

255346
```swift
256-
protocol Surface {...}
257-
258-
protocol Solid {
259-
associatedtype SurfaceType: Surface
260-
func boundary() -> SurfaceType
261-
}
262-
263-
let solid: any Solid = ...
264-
265-
// Type of 'boundary' is 'any Surface'
266-
let boundary = solid.boundary()
347+
protocol Surface {...}
348+
349+
protocol Solid {
350+
associatedtype SurfaceType: Surface
351+
func boundary() -> SurfaceType
352+
}
353+
354+
let solid: any Solid = ...
355+
356+
// Type of 'boundary' is 'any Surface'
357+
let boundary = solid.boundary()
267358
```
268359

269360
Protocol methods that take an associated type or `Self` cannot be used with `any`,
@@ -276,32 +367,32 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
276367
Protocols can now declare a list of one or more _primary associated types_, which enable writing same-type requirements on those associated types using angle bracket syntax:
277368

278369
```swift
279-
protocol Graph<Vertex, Edge> {
280-
associatedtype Vertex
281-
associatedtype Edge
282-
}
370+
protocol Graph<Vertex, Edge> {
371+
associatedtype Vertex
372+
associatedtype Edge
373+
}
283374
```
284375

285376
You can now write a protocol name followed by type arguments in angle brackets, like
286377
`Graph<Int, String>`, anywhere that a protocol conformance requirement may appear:
287378

288379
```swift
289-
func shortestPath<V, E>(_: some Graph<V, E>, from: V, to: V) -> [E]
380+
func shortestPath<V, E>(_: some Graph<V, E>, from: V, to: V) -> [E]
290381

291-
extension Graph<Int, String> {...}
382+
extension Graph<Int, String> {...}
292383

293-
func build() -> some Graph<Int, String> {}
384+
func build() -> some Graph<Int, String> {}
294385
```
295386

296387
A protocol name followed by angle brackets is shorthand for a conformance requirement,
297388
together with a same-type requirement for the protocol's primary associated types.
298389
The first two examples above are equivalent to the following:
299390

300391
```swift
301-
func shortestPath<V, E, G>(_: G, from: V, to: V) -> [E]
302-
where G: Graph, G.Vertex == V, G.Edge == E
392+
func shortestPath<V, E, G>(_: G, from: V, to: V) -> [E]
393+
where G: Graph, G.Vertex == V, G.Edge == E
303394

304-
extension Graph where Vertex == Int, Edge == String {...}
395+
extension Graph where Vertex == Int, Edge == String {...}
305396
```
306397

307398
The `build()` function returning `some Graph<Int, String>` can't be written using a
@@ -9637,9 +9728,12 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
96379728
[SE-0358]: <https://github.com/apple/swift-evolution/blob/main/proposals/0358-primary-associated-types-in-stdlib.md>
96389729
[SE-0362]: <https://github.com/apple/swift-evolution/blob/main/proposals/0362-piecemeal-future-features.md>
96399730
[SE-0365]: <https://github.com/apple/swift-evolution/blob/main/proposals/0365-implicit-self-weak-capture.md>
9731+
[SE-0366]: <https://github.com/apple/swift-evolution/blob/main/proposals/0366-move-function.md>
96409732
[SE-0370]: <https://github.com/apple/swift-evolution/blob/main/proposals/0370-pointer-family-initialization-improvements.md>
96419733
[SE-0376]: <https://github.com/apple/swift-evolution/blob/main/proposals/0376-function-back-deployment.md>
9734+
[SE-0377]: <https://github.com/apple/swift-evolution/blob/main/proposals/0377-parameter-ownership-modifiers.md>
96429735

9736+
[#64927]: <https://github.com/apple/swift/issues/64927>
96439737
[#42697]: <https://github.com/apple/swift/issues/42697>
96449738
[#42728]: <https://github.com/apple/swift/issues/42728>
96459739
[#43036]: <https://github.com/apple/swift/issues/43036>

0 commit comments

Comments
 (0)