Skip to content

Commit d92c5ce

Browse files
committed
Borrow -> Borrowing
1 parent 82d40b3 commit d92c5ce

File tree

4 files changed

+62
-62
lines changed

4 files changed

+62
-62
lines changed

stdlib/public/core/BorrowIteratorProtocol.swift renamed to stdlib/public/core/BorrowingIteratorProtocol.swift

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
@available(SwiftStdlib 6.3, *)
14-
public protocol BorrowIteratorProtocol<Element>: ~Copyable, ~Escapable {
14+
public protocol BorrowingIteratorProtocol<Element>: ~Copyable, ~Escapable {
1515
associatedtype Element: ~Copyable
1616

1717
// FIXME: This ought to be a core requirement, but `Ref` is not a thing yet.
@@ -90,7 +90,7 @@ public protocol BorrowIteratorProtocol<Element>: ~Copyable, ~Escapable {
9090
}
9191

9292
@available(SwiftStdlib 6.3, *)
93-
extension BorrowIteratorProtocol where Self: ~Copyable & ~Escapable {
93+
extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable {
9494
@_alwaysEmitIntoClient
9595
@_lifetime(&self)
9696
@_lifetime(self: copy self)
@@ -101,7 +101,7 @@ extension BorrowIteratorProtocol where Self: ~Copyable & ~Escapable {
101101
}
102102

103103
@available(SwiftStdlib 6.3, *)
104-
extension BorrowIteratorProtocol where Self: ~Copyable & ~Escapable {
104+
extension BorrowingIteratorProtocol where Self: ~Copyable & ~Escapable {
105105
@_alwaysEmitIntoClient
106106
@_lifetime(self: copy self)
107107
public mutating func skip(by offset: Int) -> Int {
@@ -115,29 +115,29 @@ extension BorrowIteratorProtocol where Self: ~Copyable & ~Escapable {
115115
}
116116
}
117117

118-
@available(SwiftStdlib 6.3, *)
119-
extension Span: Iterable where Element: ~Copyable {
120-
// FIXME: This simple definition cannot also be a backward (or bidirectional)
121-
// iterator, nor a random-access iterator. If we want to go in that direction,
122-
// we'll need to rather introduce a type more like `RigidArray.BorrowIterator`.
123-
public typealias BorrowIterator = Self
124-
125-
@_alwaysEmitIntoClient
126-
@_transparent
127-
public var estimatedCount: EstimatedCount {
128-
.exactly(count)
129-
}
130-
131-
@_alwaysEmitIntoClient
132-
@_lifetime(copy self)
133-
@_transparent
134-
public func startBorrowIteration() -> Span<Element> {
135-
self
136-
}
137-
}
118+
//@available(SwiftStdlib 6.3, *)
119+
//extension Span: Iterable where Element: ~Copyable {
120+
// // FIXME: This simple definition cannot also be a backward (or bidirectional)
121+
// // iterator, nor a random-access iterator. If we want to go in that direction,
122+
// // we'll need to rather introduce a type more like `RigidArray.BorrowIterator`.
123+
// public typealias BorrowIterator = Self
124+
//
125+
// @_alwaysEmitIntoClient
126+
// @_transparent
127+
// public var estimatedCount: EstimatedCount {
128+
// .exactly(count)
129+
// }
130+
//
131+
// @_alwaysEmitIntoClient
132+
// @_lifetime(copy self)
133+
// @_transparent
134+
// public func startBorrowIteration() -> Span<Element> {
135+
// self
136+
// }
137+
//}
138138

139139
@available(SwiftStdlib 6.3, *)
140-
extension Span: BorrowIteratorProtocol where Element: ~Copyable {
140+
extension Span: BorrowingIteratorProtocol where Element: ~Copyable {
141141
@_alwaysEmitIntoClient
142142
@_lifetime(&self)
143143
@_lifetime(self: copy self)
@@ -148,38 +148,38 @@ extension Span: BorrowIteratorProtocol where Element: ~Copyable {
148148
}
149149
}
150150

151-
@available(SwiftStdlib 6.3, *)
152-
extension MutableSpan: Iterable where Element: ~Copyable {
153-
public typealias BorrowIterator = Span<Element>.BorrowIterator
154-
155-
@_alwaysEmitIntoClient
156-
@_transparent
157-
public var estimatedCount: EstimatedCount {
158-
.exactly(count)
159-
}
160-
161-
@_alwaysEmitIntoClient
162-
@_lifetime(borrow self)
163-
@_transparent
164-
public func startBorrowIteration() -> Span<Element> {
165-
span
166-
}
167-
}
168-
169-
@available(SwiftStdlib 6.3, *)
170-
extension OutputSpan: Iterable where Element: ~Copyable {
171-
public typealias BorrowIterator = Span<Element>.BorrowIterator
172-
173-
@_alwaysEmitIntoClient
174-
@_transparent
175-
public var estimatedCount: EstimatedCount {
176-
.exactly(count)
177-
}
178-
179-
@_alwaysEmitIntoClient
180-
@_lifetime(borrow self)
181-
@_transparent
182-
public func startBorrowIteration() -> Span<Element> {
183-
self.span
184-
}
185-
}
151+
//@available(SwiftStdlib 6.3, *)
152+
//extension MutableSpan: Iterable where Element: ~Copyable {
153+
// public typealias BorrowIterator = Span<Element>.BorrowIterator
154+
//
155+
// @_alwaysEmitIntoClient
156+
// @_transparent
157+
// public var estimatedCount: EstimatedCount {
158+
// .exactly(count)
159+
// }
160+
//
161+
// @_alwaysEmitIntoClient
162+
// @_lifetime(borrow self)
163+
// @_transparent
164+
// public func startBorrowIteration() -> Span<Element> {
165+
// span
166+
// }
167+
//}
168+
//
169+
//@available(SwiftStdlib 6.3, *)
170+
//extension OutputSpan: Iterable where Element: ~Copyable {
171+
// public typealias BorrowIterator = Span<Element>.BorrowIterator
172+
//
173+
// @_alwaysEmitIntoClient
174+
// @_transparent
175+
// public var estimatedCount: EstimatedCount {
176+
// .exactly(count)
177+
// }
178+
//
179+
// @_alwaysEmitIntoClient
180+
// @_lifetime(borrow self)
181+
// @_transparent
182+
// public func startBorrowIteration() -> Span<Element> {
183+
// self.span
184+
// }
185+
//}

stdlib/public/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ split_embedded_sources(
4545
EMBEDDED BidirectionalCollection.swift
4646
EMBEDDED Bitset.swift
4747
EMBEDDED Bool.swift
48-
EMBEDDED BorrowIteratorProtocol.swift
48+
EMBEDDED BorrowingIteratorProtocol.swift
4949
NORMAL BridgeObjectiveC.swift
5050
EMBEDDED BridgeStorage.swift
5151
NORMAL BridgingBuffer.swift

stdlib/public/core/GroupInfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
"InlineArray.swift",
279279
"_InlineArray.swift",
280280
"Iterable.swift",
281-
"BorrowIteratorProtocol.swift"
281+
"BorrowingIteratorProtocol.swift"
282282
],
283283
"Result": [
284284
"Result.swift"

stdlib/public/core/Iterable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public enum EstimatedCount {
2121
@available(SwiftStdlib 6.3, *)
2222
public protocol Iterable<Element>: ~Copyable, ~Escapable {
2323
associatedtype Element: ~Copyable
24-
associatedtype BorrowIterator: BorrowIteratorProtocol<Element> & ~Copyable & ~Escapable
24+
associatedtype BorrowIterator: BorrowingIteratorProtocol<Element> & ~Copyable & ~Escapable
2525

2626
var isEmpty: Bool { get }
2727

0 commit comments

Comments
 (0)