Skip to content

Commit 7f4caed

Browse files
committed
[stdlib] avoid primary associated type for the time being
1 parent dfda525 commit 7f4caed

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

stdlib/public/core/UnsafeBufferPointer.swift.gyb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,9 +711,9 @@ extension Unsafe${Mutable}BufferPointer {
711711
/// by this function.
712712
@inlinable
713713
@_alwaysEmitIntoClient
714-
public func initialize(
715-
fromContentsOf source: some Collection<Element>
716-
) -> Index {
714+
public func initialize<C: Collection>(
715+
fromContentsOf source: C
716+
) -> Index where C.Element == Element {
717717
let count = source.withContiguousStorageIfAvailable {
718718
guard let sourceAddress = $0.baseAddress, !$0.isEmpty else {
719719
return 0
@@ -814,9 +814,9 @@ extension Unsafe${Mutable}BufferPointer {
814814
/// - Returns: An index one past the index of the last element updated.
815815
@inlinable
816816
@_alwaysEmitIntoClient
817-
public func update(
818-
fromContentsOf source: some Collection<Element>
819-
) -> Index {
817+
public func update<C: Collection>(
818+
fromContentsOf source: C
819+
) -> Index where C.Element == Element {
820820
let count = source.withContiguousStorageIfAvailable {
821821
guard let sourceAddress = $0.baseAddress else {
822822
return 0

stdlib/public/core/UnsafeBufferPointerSlice.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,9 @@ extension Slice {
763763
/// initialized by this function.
764764
@inlinable
765765
@_alwaysEmitIntoClient
766-
public func initialize<Element>(
767-
fromContentsOf source: some Collection<Element>
768-
) -> Index where Base == UnsafeMutableBufferPointer<Element> {
766+
public func initialize<C: Collection>(
767+
fromContentsOf source: C
768+
) -> Index where Base == UnsafeMutableBufferPointer<C.Element> {
769769
let buffer = Base(rebasing: self)
770770
let index = buffer.initialize(fromContentsOf: source)
771771
let distance = buffer.distance(from: buffer.startIndex, to: index)
@@ -833,9 +833,9 @@ extension Slice {
833833
/// - Returns: An index one past the index of the last element updated.
834834
@inlinable
835835
@_alwaysEmitIntoClient
836-
public func update<Element>(
837-
fromContentsOf source: some Collection<Element>
838-
) -> Index where Base == UnsafeMutableBufferPointer<Element> {
836+
public func update<C: Collection>(
837+
fromContentsOf source: C
838+
) -> Index where Base == UnsafeMutableBufferPointer<C.Element> {
839839
let buffer = Base(rebasing: self)
840840
let index = buffer.update(fromContentsOf: source)
841841
let distance = buffer.distance(from: buffer.startIndex, to: index)

0 commit comments

Comments
 (0)