Skip to content

[5.0][stdlib][ABI] mark reduce(_:into:) __owned #20875

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
2 changes: 1 addition & 1 deletion stdlib/public/core/SequenceAlgorithms.swift
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ extension Sequence {
/// - Complexity: O(*n*), where *n* is the length of the sequence.
@inlinable
public func reduce<Result>(
into initialResult: Result,
into initialResult: __owned Result,
_ updateAccumulatingResult:
(_ partialResult: inout Result, Element) throws -> ()
) rethrows -> Result {
Expand Down
2 changes: 2 additions & 0 deletions test/api-digester/Outputs/stability-stdlib-abi.swift.expected
Original file line number Diff line number Diff line change
Expand Up @@ -515,3 +515,5 @@ Func LazyCollectionProtocol.map(_:) has been removed
Func LazyCollectionProtocol.prefix(while:) has been removed
Func LazyCollectionProtocol.reversed() has been removed
Var LazyCollectionProtocol.lazy has declared type change from LazyCollection<τ_0_0.Elements> to LazySequence<τ_0_0.Elements>

Func Sequence.reduce(into:_:) has parameter 0 changing from Default to Owned
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,5 @@ Func LazyCollectionProtocol.map(_:) has been removed
Func LazyCollectionProtocol.prefix(while:) has been removed
Func LazyCollectionProtocol.reversed() has been removed
Var LazyCollectionProtocol.lazy has declared type change from LazyCollection<Self.Elements> to LazySequence<Self.Elements>

Func Sequence.reduce(into:_:) has parameter 0 changing from Default to Owned