Skip to content

Commit 0912fa2

Browse files
authored
[5.5][Concurrency] Use SwiftStdlib 5.5 availability macro in Concurrency module and tests (#37272)
* [Concurrency] Define the availability macro SwiftStdlib 5.5 The use of an availability macro will make it easier to update those versions to the marketing versions when they are announced. Plus internal branches can redefine only the macro for customized availability. * [Concurrency] Use the SwiftStdlib 5.5 availability macro * [Test] Define availability macro SwiftStdlib 5.5 for all tests rdar://77929657 * [Test] Use the SwiftStdlib 5.5 macro in Concurrency tests
1 parent 4c2b564 commit 0912fa2

File tree

87 files changed

+446
-438
lines changed

Some content is hidden

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

87 files changed

+446
-438
lines changed

stdlib/public/Concurrency/Actor.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,30 @@ import Swift
1717
///
1818
/// The \c Actor protocol generalizes over all actor types. Actor types
1919
/// implicitly conform to this protocol.
20-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
20+
@available(SwiftStdlib 5.5, *)
2121
public protocol Actor: AnyObject, Sendable {
2222
}
2323

2424
/// Called to initialize the default actor instance in an actor.
2525
/// The implementation will call this within the actor's initializer.
26-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
26+
@available(SwiftStdlib 5.5, *)
2727
@_silgen_name("swift_defaultActor_initialize")
2828
public func _defaultActorInitialize(_ actor: AnyObject)
2929

3030
/// Called to destroy the default actor instance in an actor.
3131
/// The implementation will call this within the actor's deinit.
32-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
32+
@available(SwiftStdlib 5.5, *)
3333
@_silgen_name("swift_defaultActor_destroy")
3434
public func _defaultActorDestroy(_ actor: AnyObject)
3535

3636
/// FIXME: only exists for the quick-and-dirty MainActor implementation.
37-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
37+
@available(SwiftStdlib 5.5, *)
3838
@_silgen_name("swift_MainActor_register")
3939
fileprivate func _registerMainActor(actor: AnyObject)
4040

4141
/// A singleton actor whose executor is equivalent to
4242
/// \c DispatchQueue.main, which is the main dispatch queue.
43-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
43+
@available(SwiftStdlib 5.5, *)
4444
@globalActor public actor MainActor {
4545
public static let shared = MainActor()
4646

@@ -49,7 +49,7 @@ fileprivate func _registerMainActor(actor: AnyObject)
4949
}
5050
}
5151

52-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
52+
@available(SwiftStdlib 5.5, *)
5353
extension MainActor {
5454
/// Execute the given body closure on the main actor.
5555
public static func run<T>(

stdlib/public/Concurrency/AsyncCompactMapSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func compactMap<ElementOfResult>(
@@ -22,7 +22,7 @@ extension AsyncSequence {
2222
}
2323
}
2424

25-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
25+
@available(SwiftStdlib 5.5, *)
2626
public struct AsyncCompactMapSequence<Base: AsyncSequence, ElementOfResult> {
2727
@usableFromInline
2828
let base: Base
@@ -40,7 +40,7 @@ public struct AsyncCompactMapSequence<Base: AsyncSequence, ElementOfResult> {
4040
}
4141
}
4242

43-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
43+
@available(SwiftStdlib 5.5, *)
4444
extension AsyncCompactMapSequence: AsyncSequence {
4545
public typealias Element = ElementOfResult
4646
public typealias AsyncIterator = Iterator

stdlib/public/Concurrency/AsyncDropFirstSequence.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func dropFirst(
@@ -24,7 +24,7 @@ extension AsyncSequence {
2424
}
2525
}
2626

27-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
27+
@available(SwiftStdlib 5.5, *)
2828
public struct AsyncDropFirstSequence<Base: AsyncSequence> {
2929
@usableFromInline
3030
let base: Base
@@ -39,7 +39,7 @@ public struct AsyncDropFirstSequence<Base: AsyncSequence> {
3939
}
4040
}
4141

42-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
42+
@available(SwiftStdlib 5.5, *)
4343
extension AsyncDropFirstSequence: AsyncSequence {
4444
public typealias Element = Base.Element
4545
public typealias AsyncIterator = Iterator
@@ -78,7 +78,7 @@ extension AsyncDropFirstSequence: AsyncSequence {
7878
}
7979
}
8080

81-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
81+
@available(SwiftStdlib 5.5, *)
8282
extension AsyncDropFirstSequence {
8383
@inlinable
8484
public __consuming func dropFirst(

stdlib/public/Concurrency/AsyncDropWhileSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func drop(
@@ -22,7 +22,7 @@ extension AsyncSequence {
2222
}
2323
}
2424

25-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
25+
@available(SwiftStdlib 5.5, *)
2626
public struct AsyncDropWhileSequence<Base: AsyncSequence> {
2727
@usableFromInline
2828
let base: Base
@@ -40,7 +40,7 @@ public struct AsyncDropWhileSequence<Base: AsyncSequence> {
4040
}
4141
}
4242

43-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
43+
@available(SwiftStdlib 5.5, *)
4444
extension AsyncDropWhileSequence: AsyncSequence {
4545
public typealias Element = Base.Element
4646
public typealias AsyncIterator = Iterator

stdlib/public/Concurrency/AsyncFilterSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func filter(
@@ -22,7 +22,7 @@ extension AsyncSequence {
2222
}
2323
}
2424

25-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
25+
@available(SwiftStdlib 5.5, *)
2626
public struct AsyncFilterSequence<Base: AsyncSequence> {
2727
@usableFromInline
2828
let base: Base
@@ -40,7 +40,7 @@ public struct AsyncFilterSequence<Base: AsyncSequence> {
4040
}
4141
}
4242

43-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
43+
@available(SwiftStdlib 5.5, *)
4444
extension AsyncFilterSequence: AsyncSequence {
4545
public typealias Element = Base.Element
4646
public typealias AsyncIterator = Iterator

stdlib/public/Concurrency/AsyncFlatMapSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func flatMap<SegmentOfResult: AsyncSequence>(
@@ -22,7 +22,7 @@ extension AsyncSequence {
2222
}
2323
}
2424

25-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
25+
@available(SwiftStdlib 5.5, *)
2626
public struct AsyncFlatMapSequence<Base: AsyncSequence, SegmentOfResult: AsyncSequence> {
2727
@usableFromInline
2828
let base: Base
@@ -40,7 +40,7 @@ public struct AsyncFlatMapSequence<Base: AsyncSequence, SegmentOfResult: AsyncSe
4040
}
4141
}
4242

43-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
43+
@available(SwiftStdlib 5.5, *)
4444
extension AsyncFlatMapSequence: AsyncSequence {
4545
public typealias Element = SegmentOfResult.Element
4646
public typealias AsyncIterator = Iterator

stdlib/public/Concurrency/AsyncIteratorProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
@rethrows
1717
public protocol AsyncIteratorProtocol {
1818
associatedtype Element

stdlib/public/Concurrency/AsyncMapSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func map<Transformed>(
@@ -22,7 +22,7 @@ extension AsyncSequence {
2222
}
2323
}
2424

25-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
25+
@available(SwiftStdlib 5.5, *)
2626
public struct AsyncMapSequence<Base: AsyncSequence, Transformed> {
2727
@usableFromInline
2828
let base: Base
@@ -40,7 +40,7 @@ public struct AsyncMapSequence<Base: AsyncSequence, Transformed> {
4040
}
4141
}
4242

43-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
43+
@available(SwiftStdlib 5.5, *)
4444
extension AsyncMapSequence: AsyncSequence {
4545
public typealias Element = Transformed
4646
public typealias AsyncIterator = Iterator

stdlib/public/Concurrency/AsyncPrefixSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func prefix(
@@ -24,7 +24,7 @@ extension AsyncSequence {
2424
}
2525
}
2626

27-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
27+
@available(SwiftStdlib 5.5, *)
2828
public struct AsyncPrefixSequence<Base: AsyncSequence> {
2929
@usableFromInline
3030
let base: Base
@@ -39,7 +39,7 @@ public struct AsyncPrefixSequence<Base: AsyncSequence> {
3939
}
4040
}
4141

42-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
42+
@available(SwiftStdlib 5.5, *)
4343
extension AsyncPrefixSequence: AsyncSequence {
4444
public typealias Element = Base.Element
4545
public typealias AsyncIterator = Iterator

stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func prefix(
@@ -22,7 +22,7 @@ extension AsyncSequence {
2222
}
2323
}
2424

25-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
25+
@available(SwiftStdlib 5.5, *)
2626
public struct AsyncPrefixWhileSequence<Base: AsyncSequence> {
2727
@usableFromInline
2828
let base: Base
@@ -40,7 +40,7 @@ public struct AsyncPrefixWhileSequence<Base: AsyncSequence> {
4040
}
4141
}
4242

43-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
43+
@available(SwiftStdlib 5.5, *)
4444
extension AsyncPrefixWhileSequence: AsyncSequence {
4545
public typealias Element = Base.Element
4646
public typealias AsyncIterator = Iterator

stdlib/public/Concurrency/AsyncSequence.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
@rethrows
1717
public protocol AsyncSequence {
1818
associatedtype AsyncIterator: AsyncIteratorProtocol where AsyncIterator.Element == Element
1919
associatedtype Element
2020
__consuming func makeAsyncIterator() -> AsyncIterator
2121
}
2222

23-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
23+
@available(SwiftStdlib 5.5, *)
2424
extension AsyncSequence {
2525
@inlinable
2626
public func reduce<Result>(
@@ -51,7 +51,7 @@ extension AsyncSequence {
5151
}
5252
}
5353

54-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
54+
@available(SwiftStdlib 5.5, *)
5555
@inlinable
5656
@inline(__always)
5757
func _contains<Source: AsyncSequence>(
@@ -66,7 +66,7 @@ func _contains<Source: AsyncSequence>(
6666
return false
6767
}
6868

69-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
69+
@available(SwiftStdlib 5.5, *)
7070
extension AsyncSequence {
7171
@inlinable
7272
public func contains(
@@ -83,7 +83,7 @@ extension AsyncSequence {
8383
}
8484
}
8585

86-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
86+
@available(SwiftStdlib 5.5, *)
8787
extension AsyncSequence where Element: Equatable {
8888
@inlinable
8989
public func contains(_ search: Element) async rethrows -> Bool {
@@ -96,7 +96,7 @@ extension AsyncSequence where Element: Equatable {
9696
}
9797
}
9898

99-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
99+
@available(SwiftStdlib 5.5, *)
100100
@inlinable
101101
@inline(__always)
102102
func _first<Source: AsyncSequence>(
@@ -111,7 +111,7 @@ func _first<Source: AsyncSequence>(
111111
return nil
112112
}
113113

114-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
114+
@available(SwiftStdlib 5.5, *)
115115
extension AsyncSequence {
116116
@inlinable
117117
public func first(
@@ -121,7 +121,7 @@ extension AsyncSequence {
121121
}
122122
}
123123

124-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
124+
@available(SwiftStdlib 5.5, *)
125125
extension AsyncSequence {
126126
@inlinable
127127
@warn_unqualified_access
@@ -158,7 +158,7 @@ extension AsyncSequence {
158158
}
159159
}
160160

161-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
161+
@available(SwiftStdlib 5.5, *)
162162
extension AsyncSequence where Element: Comparable {
163163
@inlinable
164164
@warn_unqualified_access

stdlib/public/Concurrency/AsyncThrowingCompactMapSequence.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import Swift
1414

15-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
15+
@available(SwiftStdlib 5.5, *)
1616
extension AsyncSequence {
1717
@inlinable
1818
public __consuming func compactMap<ElementOfResult>(
@@ -22,7 +22,7 @@ extension AsyncSequence {
2222
}
2323
}
2424

25-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
25+
@available(SwiftStdlib 5.5, *)
2626
public struct AsyncThrowingCompactMapSequence<Base: AsyncSequence, ElementOfResult> {
2727
@usableFromInline
2828
let base: Base
@@ -40,7 +40,7 @@ public struct AsyncThrowingCompactMapSequence<Base: AsyncSequence, ElementOfResu
4040
}
4141
}
4242

43-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
43+
@available(SwiftStdlib 5.5, *)
4444
extension AsyncThrowingCompactMapSequence: AsyncSequence {
4545
public typealias Element = ElementOfResult
4646
public typealias AsyncIterator = Iterator

0 commit comments

Comments
 (0)