Skip to content

Commit 29f90a9

Browse files
authored
Merge pull request #20875 from airspeedswift/5.0-reduce-into-owned
[5.0][stdlib][ABI] mark reduce(_:into:) __owned
2 parents 373e2c8 + fccecf3 commit 29f90a9

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

stdlib/public/core/SequenceAlgorithms.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ extension Sequence {
723723
/// - Complexity: O(*n*), where *n* is the length of the sequence.
724724
@inlinable
725725
public func reduce<Result>(
726-
into initialResult: Result,
726+
into initialResult: __owned Result,
727727
_ updateAccumulatingResult:
728728
(_ partialResult: inout Result, Element) throws -> ()
729729
) rethrows -> Result {

test/api-digester/Outputs/stability-stdlib-abi.swift.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,3 +515,5 @@ Func LazyCollectionProtocol.map(_:) has been removed
515515
Func LazyCollectionProtocol.prefix(while:) has been removed
516516
Func LazyCollectionProtocol.reversed() has been removed
517517
Var LazyCollectionProtocol.lazy has declared type change from LazyCollection<τ_0_0.Elements> to LazySequence<τ_0_0.Elements>
518+
519+
Func Sequence.reduce(into:_:) has parameter 0 changing from Default to Owned

test/api-digester/Outputs/stability-stdlib-source.swift.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,5 @@ Func LazyCollectionProtocol.map(_:) has been removed
210210
Func LazyCollectionProtocol.prefix(while:) has been removed
211211
Func LazyCollectionProtocol.reversed() has been removed
212212
Var LazyCollectionProtocol.lazy has declared type change from LazyCollection<Self.Elements> to LazySequence<Self.Elements>
213+
214+
Func Sequence.reduce(into:_:) has parameter 0 changing from Default to Owned

0 commit comments

Comments
 (0)