Skip to content

Commit 0344f08

Browse files
authored
Merge branch 'master' into foundation-no-inlinable-shim-calls
2 parents 846e957 + aa0bf50 commit 0344f08

File tree

3,734 files changed

+468948
-336146
lines changed

Some content is hidden

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

3,734 files changed

+468948
-336146
lines changed

.flake8

Lines changed: 71 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,72 @@
11
[flake8]
2-
ignore = W291 W504
3-
filename = *.py,
4-
./utils/80+-check,
5-
./utils/backtrace-check,
6-
./benchmark/scripts/Benchmark_Driver,
7-
./benchmark/scripts/Benchmark_DTrace.in,
8-
./benchmark/scripts/Benchmark_GuardMalloc.in,
9-
./benchmark/scripts/Benchmark_RuntimeLeaksRunner.in,
10-
./utils/build-script,
11-
./utils/check-incremental,
12-
./test/Driver/Inputs/fake-toolchain/clang++,
13-
./utils/coverage/coverage-build-db,
14-
./utils/coverage/coverage-generate-data,
15-
./utils/coverage/coverage-query-db,
16-
./utils/coverage/coverage-touch-tests,
17-
./utils/gyb,
18-
./test/Driver/Inputs/fake-toolchain/ld,
19-
./utils/line-directive,
20-
./utils/swift_build_support/tests/mock-distcc,
21-
./docs/scripts/ns-html2rst,
22-
./utils/PathSanitizingFileCheck,
23-
./utils/recursive-lipo,
24-
./utils/round-trip-syntax-test,
25-
./utils/rth,
26-
./utils/run-remote,
27-
./utils/run-test,
28-
./utils/scale-test,
29-
./utils/submit-benchmark-results,
30-
./utils/update-checkout,
31-
./utils/viewcfg,
32-
./utils/symbolicate-linux-fatal,
2+
3+
filename =
4+
*.py,
5+
6+
./benchmark/scripts/Benchmark_Driver,
7+
./benchmark/scripts/Benchmark_DTrace.in,
8+
./benchmark/scripts/Benchmark_GuardMalloc.in,
9+
./benchmark/scripts/Benchmark_QuickCheck.in,
10+
./benchmark/scripts/Benchmark_RuntimeLeaksRunner.in,
11+
./benchmark/scripts/run_smoke_bench,
12+
13+
./docs/scripts/ns-html2rst,
14+
15+
./test/Driver/Inputs/fake-toolchain/ld,
16+
17+
./utils/80+-check,
18+
./utils/backtrace-check,
19+
./utils/build-parser-lib,
20+
./utils/build-script,
21+
./utils/check-incremental,
22+
./utils/coverage/coverage-build-db,
23+
./utils/coverage/coverage-generate-data,
24+
./utils/coverage/coverage-query-db,
25+
./utils/coverage/coverage-touch-tests,
26+
./utils/dev-scripts/blockifyasm,
27+
./utils/dev-scripts/split-cmdline,
28+
./utils/gyb,
29+
./utils/line-directive,
30+
./utils/PathSanitizingFileCheck,
31+
./utils/recursive-lipo,
32+
./utils/round-trip-syntax-test,
33+
./utils/rth,
34+
./utils/run-test,
35+
./utils/scale-test,
36+
./utils/submit-benchmark-results,
37+
./utils/swift_build_support/tests/mock-distcc,
38+
./utils/symbolicate-linux-fatal,
39+
./utils/update-checkout,
40+
./utils/viewcfg,
41+
42+
# TODO: We should be linting the lit configs.
43+
#lit.cfg,
44+
45+
exclude =
46+
.git,
47+
__pycache__,
48+
49+
ignore =
50+
# The black tool treats slices consistently, the E203 warning is not PEP8
51+
# compliant (https://github.com/psf/black#slices).
52+
E203,
53+
54+
# FIXME: We should not have trailing whitespace.
55+
W291,
56+
57+
# Line breaks before binary operators are not explicitly disallowed in
58+
# PEP8, rather it should be consistent throughout the project. The black
59+
# tool puts them on new lines which is to be considered a best practice
60+
# in the future.
61+
W503,
62+
63+
# Similarly ignore line break after binary operators.
64+
W504,
65+
66+
# TODO: Ignore Bugbear lints for now, but we should enable these in the
67+
# future.
68+
B,
69+
70+
# 10% larger than the standard 80 character limit. Conforms to the black
71+
# standard and Bugbear's B950.
72+
max-line-length = 88

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#==============================================================================#
2323
# Explicit files to ignore (only matches one).
2424
#==============================================================================#
25+
Brewfile.lock.json
2526
cscope.files
2627
cscope.out
2728
.vimrc
@@ -39,6 +40,9 @@ docs/_build
3940
# Visual Studio metadata
4041
.vs
4142

43+
# clangd
44+
.clangd
45+
4246
#==============================================================================#
4347
# Ignore CMake temporary files
4448
#==============================================================================#

Brewfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
brew "cmake"
2+
brew "ninja"

CHANGELOG.md

Lines changed: 120 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ CHANGELOG
66

77
| Version | Released | Toolchain |
88
| :--------------------- | :--------- | :---------- |
9-
| [Swift 5.2](#swift-52) | | |
9+
| [Swift 5.3](#swift-53) | | |
10+
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
1011
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
1112
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
1213
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
@@ -23,9 +24,103 @@ CHANGELOG
2324

2425
</details>
2526

27+
Swift 5.3
28+
----------
29+
30+
* [SE-0280][]:
31+
32+
Enum cases can now satisfy static protocol requirements. A static get-only property of type `Self` can be witnessed by an enum case with no associated values and a static function with arguments and returning `Self` can be witnessed by an enum case with associated values.
33+
34+
```swift
35+
protocol P {
36+
static var foo: Self { get }
37+
static func bar(value: Int) -> Self
38+
}
39+
40+
enum E: P {
41+
case foo // matches 'static var foo'
42+
case bar(value: Int) // matches 'static func bar(value:)'
43+
}
44+
```
45+
46+
* [SE-0267][]:
47+
48+
Non-generic members that support a generic parameter list, including nested type declarations, are now allowed to carry a contextual `where` clause against outer generic parameters. Previously, such declarations could only be expressed by placing the member inside a dedicated constrained extension.
49+
50+
```swift
51+
struct Box<Wrapped> {
52+
func boxes() -> [Box<Wrapped.Element>] where Wrapped: Sequence { ... }
53+
}
54+
```
55+
Since contextual `where` clauses are effectively visibility constraints, overrides adopting this feature must be at least as visible as the overridden method. In practice, this implies any instance of `Derived` that can access `Base.foo` must also be able to access `Derived.foo`.
56+
57+
```swift
58+
class Base<T> {
59+
func foo() where T == Int { ... }
60+
}
61+
62+
class Derived<U>: Base<U> {
63+
// OK, <U where U: Equatable> has broader visibility than <T where T == Int>
64+
override func foo() where U: Equatable { ... }
65+
}
66+
67+
* [SR-75][]:
68+
69+
Unapplied references to protocol methods are now supported. Previously this
70+
only worked for methods defined in structs, enums and classes.
71+
72+
```swift
73+
protocol Cat {
74+
func play(catToy: Toy)
75+
}
76+
77+
let fn = Cat.play(catToy:)
78+
fn(myCat)(myToy)
79+
```
80+
81+
* [SE-0266][]:
82+
83+
Enumerations with no associated values, or only `Comparable` associated values, can opt-in to synthesized `Comparable` conformance by declaring conformance to the `Comparable` protocol. The synthesized implementation orders the cases first by case-declaration order, and then by lexicographic order of the associated values (if any).
84+
85+
```swift
86+
enum Foo: Comparable {
87+
case a(Int), b(Int), c
88+
}
89+
90+
// .a(0) < .a(1) < .b(0) < .b(1) < .c
91+
```
92+
93+
* [SE-0269][]:
94+
95+
When an escaping closure explicitly captures `self` in its capture list, the
96+
use of implicit `self` is enabled within that closure. This means that the
97+
following code is now valid:
98+
99+
```swift
100+
func doStuff(_ stuff: @escaping () -> Void) {}
101+
102+
class C {
103+
var x = 0
104+
105+
func method() {
106+
doStuff { [self] in
107+
x += 1
108+
}
109+
}
110+
}
111+
```
112+
113+
This proposal also introduces new diagnostics for inserting `self` into the
114+
closure's capture list in addition to the existing 'use `self.` explicitly'
115+
fix-it.
116+
117+
**Add new entries to the top of this section, not here!**
118+
26119
Swift 5.2
27120
---------
28121

122+
### 2020-03-24 (Xcode 11.4)
123+
29124
* [SR-11841][]:
30125

31126
When chaining calls to `filter(_:)` on a lazy sequence or collection, the
@@ -166,13 +261,30 @@ Swift 5.2
166261
* `mutating func callAsFunction` is supported.
167262
* `func callAsFunction` works with `throws` and `rethrows`.
168263
* `func callAsFunction` works with trailing closures.
264+
265+
* [SE-0249][]:
266+
267+
A `\Root.value` key path expression is now allowed wherever a `(Root) -> Value`
268+
function is allowed. Such an expression is implicitly converted to a key path
269+
application of `{ $0[keyPath: \Root.value] }`.
270+
271+
For example:
272+
273+
```swift
274+
struct User {
275+
let email: String
276+
let isAdmin: Bool
277+
}
278+
279+
users.map(\.email) // this is equivalent to: users.map { $0[keyPath: \User.email] }
280+
```
169281

170282
* [SR-4206][]:
171283

172284
A method override is no longer allowed to have a generic signature with
173285
requirements not imposed by the base method. For example:
174286

175-
```
287+
```swift
176288
protocol P {}
177289

178290
class Base {
@@ -201,8 +313,6 @@ Swift 5.2
201313
print(s[0])
202314
```
203315

204-
**Add new entries to the top of this section, not here!**
205-
206316
Swift 5.1
207317
---------
208318

@@ -7853,10 +7963,16 @@ Swift 1.0
78537963
[SE-0242]: <https://github.com/apple/swift-evolution/blob/master/proposals/0242-default-values-memberwise.md>
78547964
[SE-0244]: <https://github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md>
78557965
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
7966+
[SE-0249]: <https://github.com/apple/swift-evolution/blob/master/proposals/0249-key-path-literal-function-expressions.md>
78567967
[SE-0252]: <https://github.com/apple/swift-evolution/blob/master/proposals/0252-keypath-dynamic-member-lookup.md>
78577968
[SE-0253]: <https://github.com/apple/swift-evolution/blob/master/proposals/0253-callable.md>
78587969
[SE-0254]: <https://github.com/apple/swift-evolution/blob/master/proposals/0254-static-subscripts.md>
7970+
[SE-0266]: <https://github.com/apple/swift-evolution/blob/master/proposals/0266-synthesized-comparable-for-enumerations.md>
7971+
[SE-0267]: <https://github.com/apple/swift-evolution/blob/master/proposals/0267-where-on-contextually-generic.md>
7972+
[SE-0269]: <https://github.com/apple/swift-evolution/blob/master/proposals/0269-implicit-self-explicit-capture.md>
7973+
[SE-0280]: <https://github.com/apple/swift-evolution/blob/master/proposals/0280-enum-cases-as-protocol-witnesses.md>
78597974

7975+
[SR-75]: <https://bugs.swift.org/browse/SR-75>
78607976
[SR-106]: <https://bugs.swift.org/browse/SR-106>
78617977
[SR-419]: <https://bugs.swift.org/browse/SR-419>
78627978
[SR-631]: <https://bugs.swift.org/browse/SR-631>

0 commit comments

Comments
 (0)