Skip to content

Revert hashable asyncstream inlining #81293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions stdlib/public/Concurrency/AsyncStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public struct AsyncStream<Element> {
case bufferingNewest(Int)
}

@usableFromInline
let storage: _Storage

/// Resume the task awaiting the next iteration point by having it return
Expand Down Expand Up @@ -478,17 +477,14 @@ extension AsyncStream.Continuation.YieldResult: Sendable where Element: Sendable

@available(SwiftStdlib 6.2, *)
extension AsyncStream.Continuation: Hashable {
@inlinable
@available(SwiftStdlib 6.2, *)
public func hash(into hasher: inout Hasher) {
return hasher.combine(ObjectIdentifier(storage))
}
@inlinable
@available(SwiftStdlib 6.2, *)
public var hashValue: Int {
return _hashValue(for: self)
}
@inlinable
@available(SwiftStdlib 6.2, *)
public static func == (lhs: Self, rhs: Self) -> Bool {
return lhs.storage === rhs.storage
Expand Down
2 changes: 0 additions & 2 deletions stdlib/public/Concurrency/AsyncStreamBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func _unlock(_ ptr: UnsafeRawPointer)
@available(SwiftStdlib 5.1, *)
extension AsyncStream {
@safe
@usableFromInline
internal final class _Storage: @unchecked Sendable {
typealias TerminationHandler = @Sendable (Continuation.Termination) -> Void

Expand Down Expand Up @@ -282,7 +281,6 @@ extension AsyncStream {
@available(SwiftStdlib 5.1, *)
extension AsyncThrowingStream {
@safe
@usableFromInline
internal final class _Storage: @unchecked Sendable {
typealias TerminationHandler = @Sendable (Continuation.Termination) -> Void
enum Terminal {
Expand Down
4 changes: 0 additions & 4 deletions stdlib/public/Concurrency/AsyncThrowingStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ public struct AsyncThrowingStream<Element, Failure: Error> {
case bufferingNewest(Int)
}

@usableFromInline
let storage: _Storage

/// Resume the task awaiting the next iteration point by having it return
Expand Down Expand Up @@ -524,17 +523,14 @@ extension AsyncThrowingStream.Continuation.YieldResult: Sendable where Element:

@available(SwiftStdlib 6.2, *)
extension AsyncThrowingStream.Continuation: Hashable {
@inlinable
@available(SwiftStdlib 6.2, *)
public func hash(into hasher: inout Hasher) {
return hasher.combine(ObjectIdentifier(storage))
}
@inlinable
@available(SwiftStdlib 6.2, *)
public var hashValue: Int {
return _hashValue(for: self)
}
@inlinable
@available(SwiftStdlib 6.2, *)
public static func == (lhs: Self, rhs: Self) -> Bool {
return lhs.storage === rhs.storage
Expand Down
18 changes: 0 additions & 18 deletions test/abi/macOS/arm64/concurrency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -421,21 +421,3 @@ Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ
// Clock systemEpochs
Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV
Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV

// Hashable for (Throwing)AsyncStream
Added: _$sScS12ContinuationV7storageScS8_StorageCyx_Gvg
Added: _$sScS12ContinuationV7storageScS8_StorageCyx_GvpMV
Added: _$sScS8_StorageCMa
Added: _$sScS8_StorageCMn
Added: _$sScS8_StorageCMo
Added: _$sScS8_StorageCMu
Added: _$sScS8_StorageCfD
Added: _$sScS8_StorageCfd
Added: _$sScs12ContinuationV7storageScs8_StorageCyxq__Gvg
Added: _$sScs12ContinuationV7storageScs8_StorageCyxq__GvpMV
Added: _$sScs8_StorageCMa
Added: _$sScs8_StorageCMn
Added: _$sScs8_StorageCMo
Added: _$sScs8_StorageCMu
Added: _$sScs8_StorageCfD
Added: _$sScs8_StorageCfd
18 changes: 0 additions & 18 deletions test/abi/macOS/x86_64/concurrency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -421,21 +421,3 @@ Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ
// Clock systemEpochs
Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV
Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV

// Hashable for (Throwing)AsyncStream
Added: _$sScS12ContinuationV7storageScS8_StorageCyx_Gvg
Added: _$sScS12ContinuationV7storageScS8_StorageCyx_GvpMV
Added: _$sScS8_StorageCMa
Added: _$sScS8_StorageCMn
Added: _$sScS8_StorageCMo
Added: _$sScS8_StorageCMu
Added: _$sScS8_StorageCfD
Added: _$sScS8_StorageCfd
Added: _$sScs12ContinuationV7storageScs8_StorageCyxq__Gvg
Added: _$sScs12ContinuationV7storageScs8_StorageCyxq__GvpMV
Added: _$sScs8_StorageCMa
Added: _$sScs8_StorageCMn
Added: _$sScs8_StorageCMo
Added: _$sScs8_StorageCMu
Added: _$sScs8_StorageCfD
Added: _$sScs8_StorageCfd
7 changes: 0 additions & 7 deletions test/api-digester/stability-concurrency-abi.test
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@ Func withThrowingTaskGroup(of:returning:body:) has parameter 2 type change from
Func withTaskGroup(of:returning:body:) has been renamed to Func withTaskGroup(of:returning:isolation:body:)
Func withTaskGroup(of:returning:body:) has mangled name changing from '_Concurrency.withTaskGroup<A, B where A: Swift.Sendable>(of: A.Type, returning: B.Type, body: (inout Swift.TaskGroup<A>) async -> B) async -> B' to '_Concurrency.withTaskGroup<A, B where A: Swift.Sendable>(of: A.Type, returning: B.Type, isolation: isolated Swift.Optional<Swift.Actor>, body: (inout Swift.TaskGroup<A>) async -> B) async -> B'

// Hashable for (Throwing)AsyncStream
// These are just @usableFromInline:
Var AsyncStream.Continuation.storage is a new API without '@available'
Var AsyncThrowingStream.Continuation.storage is a new API without '@available'
Class AsyncStream._Storage is a new API without '@available'
Class AsyncThrowingStream._Storage is a new API without '@available'

// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)


Expand Down