[Concurrency] Remove redundant Sendable conformances in the standard library.

These conformances are all redundant because the `Sendable` conformance is
inherited from a superclass.
This commit is contained in:
Holly Borla
2024-07-25 21:51:56 -07:00
parent 7dd8914d88
commit dc3893d9ca
6 changed files with 0 additions and 69 deletions

View File

@@ -63,9 +63,6 @@ internal final class __EmptyArrayStorage
}
}
@available(*, unavailable)
extension __EmptyArrayStorage: Sendable {}
#if $Embedded
// In embedded Swift, the stdlib is a .swiftmodule only without any .o/.a files,
// to allow consuming it by clients with different LLVM codegen setting (-mcpu
@@ -120,9 +117,6 @@ internal final class __StaticArrayStorage
}
}
@available(*, unavailable)
extension __StaticArrayStorage: Sendable {}
/// The empty array prototype. We use the same object for all empty
/// `[Native]Array<Element>`s.
@inlinable
@@ -312,9 +306,6 @@ internal final class _ContiguousArrayStorage<
}
}
@available(*, unavailable)
extension _ContiguousArrayStorage: Sendable {}
@_alwaysEmitIntoClient
@inline(__always)
internal func _uncheckedUnsafeBitCast<T, U>(_ x: T, to type: U.Type) -> U {
@@ -977,9 +968,6 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
}
}
@available(*, unavailable)
extension _ContiguousArrayBuffer: Sendable {}
/// Append the elements of `rhs` to `lhs`.
@inlinable
internal func += <Element, C: Collection>(

View File

@@ -421,9 +421,6 @@ final internal class _SwiftDeferredNSDictionary<Key: Hashable, Value>
}
}
@available(*, unavailable)
extension _SwiftDeferredNSDictionary: Sendable {}
// NOTE: older runtimes called this struct _CocoaDictionary. The two
// must coexist without conflicting ObjC class names from the nested
// classes, so it was renamed. The old names must not be used in the new

View File

@@ -110,9 +110,6 @@ internal class __RawDictionaryStorage: __SwiftNativeNSDictionary {
}
}
@available(*, unavailable)
extension __RawDictionaryStorage: Sendable {}
/// The storage class for the singleton empty set.
/// The single instance of this class is created by the runtime.
// NOTE: older runtimes called this class _EmptyDictionarySingleton.
@@ -139,9 +136,6 @@ internal class __EmptyDictionarySingleton: __RawDictionaryStorage {
#endif
}
@available(*, unavailable)
extension __EmptyDictionarySingleton: Sendable {}
#if _runtime(_ObjC)
extension __EmptyDictionarySingleton: _NSDictionaryCore {
@objc(copyWithZone:)
@@ -511,6 +505,3 @@ extension _DictionaryStorage {
return storage
}
}
extension _DictionaryStorage: @unchecked Sendable
where Key: Sendable, Value: Sendable {}

View File

@@ -166,9 +166,6 @@ internal final class _IteratorBox<Base: IteratorProtocol>
internal var _base: Base
}
@available(*, unavailable)
extension _IteratorBox: Sendable {}
//===--- Sequence ---------------------------------------------------------===//
//===----------------------------------------------------------------------===//
@@ -402,9 +399,6 @@ internal class _AnyCollectionBox<Element>: _AnySequenceBox<Element> {
) -> _AnyCollectionBox<Element> { _abstract() }
}
@available(*, unavailable)
extension _AnyCollectionBox: Sendable {}
@_fixed_layout
@usableFromInline
internal class _AnyBidirectionalCollectionBox<Element>
@@ -468,9 +462,6 @@ internal class _AnyBidirectionalCollectionBox<Element>
internal func _formIndex(before i: _AnyIndexBox) { _abstract() }
}
@available(*, unavailable)
extension _AnyBidirectionalCollectionBox: Sendable {}
@_fixed_layout
@usableFromInline
internal class _AnyRandomAccessCollectionBox<Element>
@@ -528,9 +519,6 @@ internal class _AnyRandomAccessCollectionBox<Element>
) -> _AnyRandomAccessCollectionBox<Element> { _abstract() }
}
@available(*, unavailable)
extension _AnyRandomAccessCollectionBox: Sendable {}
@_fixed_layout
@usableFromInline
internal final class _SequenceBox<S: Sequence>: _AnySequenceBox<S.Element> {
@@ -623,9 +611,6 @@ internal final class _SequenceBox<S: Sequence>: _AnySequenceBox<S.Element> {
internal var _base: S
}
@available(*, unavailable)
extension _SequenceBox: Sendable {}
@_fixed_layout
@usableFromInline
internal final class _CollectionBox<S: Collection>: _AnyCollectionBox<S.Element>
@@ -820,9 +805,6 @@ internal final class _CollectionBox<S: Collection>: _AnyCollectionBox<S.Element>
internal var _base: S
}
@available(*, unavailable)
extension _CollectionBox: Sendable {}
@_fixed_layout
@usableFromInline
internal final class _BidirectionalCollectionBox<S: BidirectionalCollection>
@@ -1036,9 +1018,6 @@ internal final class _BidirectionalCollectionBox<S: BidirectionalCollection>
internal var _base: S
}
@available(*, unavailable)
extension _BidirectionalCollectionBox: Sendable {}
@_fixed_layout
@usableFromInline
internal final class _RandomAccessCollectionBox<S: RandomAccessCollection>
@@ -1251,9 +1230,6 @@ internal final class _RandomAccessCollectionBox<S: RandomAccessCollection>
internal var _base: S
}
@available(*, unavailable)
extension _RandomAccessCollectionBox: Sendable {}
@usableFromInline
@frozen
internal struct _ClosureBasedSequence<Iterator: IteratorProtocol> {

View File

@@ -105,9 +105,6 @@ internal class __RawSetStorage: __SwiftNativeNSSet {
}
}
@available(*, unavailable)
extension __RawSetStorage: Sendable {}
/// The storage class for the singleton empty set.
/// The single instance of this class is created by the runtime.
// NOTE: older runtimes called this class _EmptySetSingleton. The two
@@ -130,9 +127,6 @@ internal class __EmptySetSingleton: __RawSetStorage {
#endif
}
@available(*, unavailable)
extension __EmptySetSingleton: Sendable {}
#if $Embedded
// In embedded Swift, the stdlib is a .swiftmodule only without any .o/.a files,
// to allow consuming it by clients with different LLVM codegen setting (-mcpu
@@ -316,9 +310,6 @@ final internal class _SetStorage<Element: Hashable>
#endif
}
@available(*, unavailable)
extension _SetStorage: Sendable {}
extension _SetStorage {
@usableFromInline
@_effects(releasenone)

View File

@@ -61,9 +61,6 @@ internal class __SwiftNativeNSArrayWithContiguousStorage
}
}
@available(*, unavailable)
extension __SwiftNativeNSArrayWithContiguousStorage: Sendable {}
private let NSNotFound: Int = .max
// Implement the APIs required by NSArray
@@ -325,9 +322,6 @@ extension __SwiftNativeNSArrayWithContiguousStorage {
}
}
@available(*, unavailable)
extension _SwiftNSMutableArray: Sendable {}
/// An `NSArray` whose contiguous storage is created and filled, upon
/// first access, by bridging the elements of a Swift `Array`.
///
@@ -435,9 +429,6 @@ extension _SwiftNSMutableArray: Sendable {}
}
}
@available(*, unavailable)
extension __SwiftDeferredNSArray: Sendable {}
/// A `__SwiftDeferredNSArray` which is used for static read-only Swift Arrays.
///
/// In contrast to its base class, `__SwiftDeferredStaticNSArray` is generic
@@ -593,6 +584,3 @@ internal class __ContiguousArrayStorageBase
self !== _emptyArrayStorage, "Deallocating empty array storage?!")
}
}
@available(*, unavailable)
extension __ContiguousArrayStorageBase: Sendable {}