[SortedSet] SortedSet, .Iterator, .Index, .SubSequence, .SubSequence.Iterator: Explicitly conform to Sendable when Element is Sendable

This commit is contained in:
Karoy Lorentey committed 2022-10-05 11:48:54 -07:00
1 parent 3238b9b575
commit 58f7cf5a92
4 files changed
+34

No files matched your search

@@ -0,0 +1,14 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Collections open source project
//
// Copyright (c) 2022 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//
#if swift(>=5.5)
extension SortedSet: @unchecked Sendable where Element: Sendable {}
#endif
@@ -49,3 +49,8 @@ extension SortedSet: Sequence {
return Iterator(_base: self)
}
}
#if swift(>=5.5)
extension SortedSet.Iterator: @unchecked Sendable
where Element: Sendable {}
#endif
@@ -30,6 +30,11 @@ extension SortedSet {
}
}
#if swift(>=5.5)
extension SortedSet.SubSequence: @unchecked Sendable
where Element: Sendable {}
#endif
extension SortedSet.SubSequence: Sequence {
public typealias Element = SortedSet.Element
@@ -66,6 +71,11 @@ extension SortedSet.SubSequence: Sequence {
}
}
#if swift(>=5.5)
extension SortedSet.SubSequence.Iterator: @unchecked Sendable
where Element: Sendable {}
#endif
extension SortedSet.SubSequence: BidirectionalCollection {
public typealias Index = SortedSet.Index
public typealias SubSequence = Self
@@ -34,6 +34,11 @@ extension SortedSet {
}
}
#if swift(>=5.5)
extension SortedSet.Index: @unchecked Sendable
where Element: Sendable {}
#endif
// MARK: Equatable
extension SortedSet.Index: Equatable {
@inlinable