Skip to content

Commit bcb3b1d

Browse files
authored
Merge pull request #74367 from lorentey/define-availability-for-6.0-on-6.0
[6.0] Define availability for the 6.0 stdlib & runtime
2 parents 1f9305f + 4545a15 commit bcb3b1d

File tree

8 files changed

+67
-55
lines changed

8 files changed

+67
-55
lines changed

benchmark/single-source/CharacterRecognizer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import TestsUtils
1414

1515
public var benchmarks: [BenchmarkInfo] {
16-
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else {
16+
guard #available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) else {
1717
return []
1818
}
1919
return [
@@ -82,7 +82,7 @@ let _asciiString = #"""
8282
"""#
8383
let asciiString = String(repeating: _asciiString, count: 10)
8484

85-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
85+
@available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *)
8686
func run(string: String, n: Int) {
8787
var state = Unicode._CharacterRecognizer()
8888
var c = 0

benchmark/single-source/StringTests.swift

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,43 @@ import TestsUtils
1414
@_spi(_Unicode)
1515
import Swift
1616

17-
public let benchmarks = [
18-
BenchmarkInfo(
19-
name: "StringEqualPointerComparison",
20-
runFunction: run_StringEqualPointerComparison,
21-
tags: [.validation, .api, .String]),
22-
BenchmarkInfo(
23-
name: "StringHasPrefixAscii",
24-
runFunction: run_StringHasPrefixAscii,
25-
tags: [.validation, .api, .String],
26-
legacyFactor: 10),
27-
BenchmarkInfo(
28-
name: "StringHasPrefixUnicode",
29-
runFunction: run_StringHasPrefixUnicode,
30-
tags: [.validation, .api, .String],
31-
legacyFactor: 1000),
32-
BenchmarkInfo(
33-
name: "StringHasSuffixAscii",
34-
runFunction: run_StringHasSuffixAscii,
35-
tags: [.validation, .api, .String],
36-
legacyFactor: 10),
37-
BenchmarkInfo(
38-
name: "StringHasSuffixUnicode",
39-
runFunction: run_StringHasSuffixUnicode,
40-
tags: [.validation, .api, .String],
41-
legacyFactor: 1000),
42-
BenchmarkInfo(
43-
name: "StringIterateWords",
44-
runFunction: run_iterateWords,
45-
tags: [.validation, .String]),
46-
]
17+
public var benchmarks: [BenchmarkInfo] {
18+
var result = [
19+
BenchmarkInfo(
20+
name: "StringEqualPointerComparison",
21+
runFunction: run_StringEqualPointerComparison,
22+
tags: [.validation, .api, .String]),
23+
BenchmarkInfo(
24+
name: "StringHasPrefixAscii",
25+
runFunction: run_StringHasPrefixAscii,
26+
tags: [.validation, .api, .String],
27+
legacyFactor: 10),
28+
BenchmarkInfo(
29+
name: "StringHasPrefixUnicode",
30+
runFunction: run_StringHasPrefixUnicode,
31+
tags: [.validation, .api, .String],
32+
legacyFactor: 1000),
33+
BenchmarkInfo(
34+
name: "StringHasSuffixAscii",
35+
runFunction: run_StringHasSuffixAscii,
36+
tags: [.validation, .api, .String],
37+
legacyFactor: 10),
38+
BenchmarkInfo(
39+
name: "StringHasSuffixUnicode",
40+
runFunction: run_StringHasSuffixUnicode,
41+
tags: [.validation, .api, .String],
42+
legacyFactor: 1000),
43+
]
44+
45+
if #available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) {
46+
result.append(
47+
BenchmarkInfo(
48+
name: "StringIterateWords",
49+
runFunction: run_iterateWords,
50+
tags: [.validation, .String]))
51+
}
52+
return result
53+
}
4754

4855
// FIXME(string)
4956
public func run_StringHasPrefixAscii(_ n: Int) {
@@ -1644,11 +1651,8 @@ architecture on Linux.</p>
16441651

16451652
extension String {
16461653
@inline(never)
1647-
@available(SwiftStdlib 5.9, *)
1654+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
16481655
var _words: [Substring] {
1649-
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else {
1650-
fatalError("Can't run this benchmark")
1651-
}
16521656
var result: [Substring] = []
16531657

16541658
var i = startIndex
@@ -1666,6 +1670,7 @@ extension String {
16661670
}
16671671
}
16681672

1673+
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
16691674
public func run_iterateWords(_ n: Int) {
16701675
for _ in 0 ..< n {
16711676
blackHole(swiftOrgHTML._words)

include/swift/AST/FeatureAvailability.def

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ FEATURE(ConcurrencyDiscardingTaskGroup, (5, 9))
6464
FEATURE(ConcurrencyDistributedActorWithCustomExecutor, (5, 9))
6565
FEATURE(SignedDescriptor, (5, 9))
6666

67-
FEATURE(ObjCSymbolicReferences, (5, 11))
68-
FEATURE(TypedThrows, (5, 11))
69-
FEATURE(StaticReadOnlyArrays, (5, 11))
70-
FEATURE(SwiftExceptionPersonality, (5, 11))
67+
FEATURE(ObjCSymbolicReferences, (6, 0))
68+
FEATURE(TypedThrows, (6, 0))
69+
FEATURE(StaticReadOnlyArrays, (6, 0))
70+
FEATURE(SwiftExceptionPersonality, (6, 0))
7171
// Metadata support for @isolated(any) function types
72-
FEATURE(IsolatedAny, (5, 11))
72+
FEATURE(IsolatedAny, (6, 0))
7373

7474
FEATURE(TaskExecutor, FUTURE)
7575
FEATURE(Differentiation, FUTURE)

include/swift/AST/RuntimeVersions.def

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,19 @@ RUNTIME_VERSION(
138138
PLATFORM(xrOS, (1, 0, 0))
139139
)
140140

141+
END_MAJOR_VERSION(5)
142+
143+
MAJOR_VERSION(6)
144+
141145
RUNTIME_VERSION(
142-
(5, 11),
143-
FUTURE
146+
(6, 0),
147+
PLATFORM(macOS, (15, 0, 0))
148+
PLATFORM(iOS, (18, 0, 0))
149+
PLATFORM(watchOS, (11, 0, 0))
150+
PLATFORM(xrOS, (2, 0, 0))
144151
)
145152

146-
END_MAJOR_VERSION(5)
153+
END_MAJOR_VERSION(6)
147154

148155
// .......................................................................... //
149156

stdlib/public/ClangOverlays/float.swift.gyb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public let FLT_RADIX = Double.radix
2525
// significand bit, but Swift does not. Neither is really right or wrong.
2626
@available(swift, deprecated: 3.0, message: "Please use '${type}.significandBitCount + 1'.")
2727
@available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, *)
28-
@_originallyDefinedIn(module: "Darwin", macOS 9999, iOS 9999, watchOS 9999, tvOS 9999)
28+
@_originallyDefinedIn(module: "Darwin", macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0)
2929
public let ${prefix}_MANT_DIG = ${type}.significandBitCount + 1
3030

3131
// Where does the 1 come from? C models floating-point numbers as having a
@@ -34,32 +34,32 @@ public let ${prefix}_MANT_DIG = ${type}.significandBitCount + 1
3434
// as well.
3535
@available(swift, deprecated: 3.0, message: "Please use '${type}.greatestFiniteMagnitude.exponent + 1'.")
3636
@available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, *)
37-
@_originallyDefinedIn(module: "Darwin", macOS 9999, iOS 9999, watchOS 9999, tvOS 9999)
37+
@_originallyDefinedIn(module: "Darwin", macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0)
3838
public let ${prefix}_MAX_EXP = ${type}.greatestFiniteMagnitude.exponent + 1
3939

4040
@available(swift, deprecated: 3.0, message: "Please use '${type}.leastNormalMagnitude.exponent + 1'.")
4141
@available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, *)
42-
@_originallyDefinedIn(module: "Darwin", macOS 9999, iOS 9999, watchOS 9999, tvOS 9999)
42+
@_originallyDefinedIn(module: "Darwin", macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0)
4343
public let ${prefix}_MIN_EXP = ${type}.leastNormalMagnitude.exponent + 1
4444

4545
@available(swift, deprecated: 3.0, message: "Please use '${type}.greatestFiniteMagnitude' or '.greatestFiniteMagnitude'.")
4646
@available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, *)
47-
@_originallyDefinedIn(module: "Darwin", macOS 9999, iOS 9999, watchOS 9999, tvOS 9999)
47+
@_originallyDefinedIn(module: "Darwin", macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0)
4848
public let ${prefix}_MAX = ${type}.greatestFiniteMagnitude
4949

5050
@available(swift, deprecated: 3.0, message: "Please use '${type}.ulpOfOne' or '.ulpOfOne'.")
5151
@available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, *)
52-
@_originallyDefinedIn(module: "Darwin", macOS 9999, iOS 9999, watchOS 9999, tvOS 9999)
52+
@_originallyDefinedIn(module: "Darwin", macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0)
5353
public let ${prefix}_EPSILON = ${type}.ulpOfOne
5454

5555
@available(swift, deprecated: 3.0, message: "Please use '${type}.leastNormalMagnitude' or '.leastNormalMagnitude'.")
5656
@available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, *)
57-
@_originallyDefinedIn(module: "Darwin", macOS 9999, iOS 9999, watchOS 9999, tvOS 9999)
57+
@_originallyDefinedIn(module: "Darwin", macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0)
5858
public let ${prefix}_MIN = ${type}.leastNormalMagnitude
5959

6060
@available(swift, deprecated: 3.0, message: "Please use '${type}.leastNonzeroMagnitude' or '.leastNonzeroMagnitude'.")
6161
@available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, *)
62-
@_originallyDefinedIn(module: "Darwin", macOS 9999, iOS 9999, watchOS 9999, tvOS 9999)
62+
@_originallyDefinedIn(module: "Darwin", macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0)
6363
public let ${prefix}_TRUE_MIN = ${type}.leastNonzeroMagnitude
6464

6565
% if type == "Float80":

stdlib/public/core/ErrorType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func _willThrowTypedImpl<E: Error>(_ error: E)
195195
@_alwaysEmitIntoClient
196196
@_silgen_name("swift_willThrowTyped")
197197
public func _willThrowTyped<E: Error>(_ error: E) {
198-
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999, *) {
198+
if #available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) {
199199
_willThrowTypedImpl(error)
200200
}
201201
}

test/ModuleInterface/distributed-actor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public distributed actor DAG<ActorSystem> where ActorSystem: DistributedActorSys
6767
// CHECK: get
6868
// CHECK: }
6969
// CHECK: public init(actorSystem system: ActorSystem)
70-
// CHECK: @available(iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999, macOS 9999, *)
70+
// CHECK: @available(iOS 18.0, tvOS 18.0, watchOS 11.0, visionOS 2.0, macOS 15.0, *)
7171
// CHECK: @_semantics("defaultActor") nonisolated final public var unownedExecutor: _Concurrency.UnownedSerialExecutor {
7272
// CHECK: get
7373
// CHECK: }
@@ -84,7 +84,7 @@ public distributed actor DAG<ActorSystem> where ActorSystem: DistributedActorSys
8484
// CHECK-NEXT:extension Library.DA : Swift.Decodable {}
8585

8686
// CHECK-NOT: #if compiler(>=5.3) && $Actors
87-
// CHECK: @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999, *)
87+
// CHECK: @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
8888
// CHECK-NEXT: extension Library.DAG : Distributed.DistributedActor {}
8989

9090
//--- Client.swift

utils/availability-macros.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0
3535
SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4
3636
SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0
3737
SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1
38-
SwiftStdlib 6.0:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999
38+
SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0
3939
# TODO: Also update ASTContext::getSwift510Availability when needed
4040
# TODO: Also update ASTContext::getSwift60Availability when needed
4141

0 commit comments

Comments
 (0)