Skip to content

Commit cf1c92f

Browse files
committed
[stdlib] Remove all new public API for now
1 parent 38001ae commit cf1c92f

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

stdlib/public/core/NFC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ extension Unicode._InternalNFC.Iterator: IteratorProtocol {
206206
}
207207

208208
// If we have a leftover composee, make sure to return it.
209-
return composee.take()
209+
return composee._take()
210210
}
211211
}
212212

stdlib/public/core/Optional.swift

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ extension Optional {
200200
}
201201

202202
extension Optional where Wrapped: ~Copyable {
203+
// FIXME(NCG): Make this public.
203204
@_alwaysEmitIntoClient
204-
public consuming func consumingMap<U: ~Copyable, E: Error>(
205+
public consuming func _consumingMap<U: ~Copyable, E: Error>(
205206
_ transform: (consuming Wrapped) throws(E) -> U
206207
) throws(E) -> U? {
207208
switch consume self {
@@ -213,8 +214,9 @@ extension Optional where Wrapped: ~Copyable {
213214
}
214215

215216
#if hasFeature(BorrowingSwitch)
217+
// FIXME(NCG): Make this public.
216218
@_alwaysEmitIntoClient
217-
public borrowing func borrowingMap<U: ~Copyable, E: Error>(
219+
public borrowing func _borrowingMap<U: ~Copyable, E: Error>(
218220
_ transform: (borrowing Wrapped) throws(E) -> U
219221
) throws(E) -> U? {
220222
switch self {
@@ -262,8 +264,9 @@ extension Optional {
262264
}
263265

264266
extension Optional where Wrapped: ~Copyable {
267+
// FIXME(NCG): Make this public.
265268
@_alwaysEmitIntoClient
266-
public consuming func consumingFlatMap<U: ~Copyable, E: Error>(
269+
public consuming func _consumingFlatMap<U: ~Copyable, E: Error>(
267270
_ transform: (consuming Wrapped) throws(E) -> U?
268271
) throws(E) -> U? {
269272
switch consume self {
@@ -275,8 +278,9 @@ extension Optional where Wrapped: ~Copyable {
275278
}
276279

277280
#if hasFeature(BorrowingSwitch)
281+
// FIXME(NCG): Make this public.
278282
@_alwaysEmitIntoClient
279-
public func borrowingFlatMap<U: ~Copyable, E: Error>(
283+
public func _borrowingFlatMap<U: ~Copyable, E: Error>(
280284
_ transform: (borrowing Wrapped) throws(E) -> U?
281285
) throws(E) -> U? {
282286
switch self {
@@ -326,9 +330,9 @@ extension Optional {
326330
}
327331

328332
extension Optional where Wrapped: ~Copyable {
329-
// FIXME(NCG): Do we want this? It seems like we do.
333+
// FIXME(NCG): Do we want this? It seems like we do. Make this public.
330334
@_alwaysEmitIntoClient
331-
public consuming func consumingUnsafelyUnwrap() -> Wrapped {
335+
public consuming func _consumingUnsafelyUnwrap() -> Wrapped {
332336
switch consume self {
333337
case .some(let x):
334338
return x
@@ -386,8 +390,8 @@ extension Optional where Wrapped: ~Copyable {
386390
///
387391
/// - Returns: The wrapped value being stored in this instance. If this
388392
/// instance is `nil`, returns `nil`.
389-
@_alwaysEmitIntoClient // FIXME(NCG): This is new in Swift 6
390-
public mutating func take() -> Self {
393+
@_alwaysEmitIntoClient // FIXME(NCG): Make this public.
394+
public mutating func _take() -> Self {
391395
let result = consume self
392396
self = nil
393397
return result

stdlib/public/core/Result.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ extension Result {
6363
}
6464

6565
extension Result where Success: ~Copyable {
66+
// FIXME(NCG): Make this public.
6667
@_alwaysEmitIntoClient
67-
public consuming func consumingMap<NewSuccess: ~Copyable>(
68+
public consuming func _consumingMap<NewSuccess: ~Copyable>(
6869
_ transform: (consuming Success) -> NewSuccess
6970
) -> Result<NewSuccess, Failure> {
7071
switch consume self {
@@ -76,8 +77,9 @@ extension Result where Success: ~Copyable {
7677
}
7778

7879
#if $BorrowingSwitch
80+
// FIXME(NCG): Make this public.
7981
@_alwaysEmitIntoClient
80-
public borrowing func borrowingMap<NewSuccess: ~Copyable>(
82+
public borrowing func _borrowingMap<NewSuccess: ~Copyable>(
8183
_ transform: (borrowing Success) -> NewSuccess
8284
) -> Result<NewSuccess, Failure> {
8385
switch self {
@@ -187,8 +189,9 @@ extension Result {
187189
}
188190

189191
extension Result where Success: ~Copyable {
192+
// FIXME(NCG): Make this public.
190193
@_alwaysEmitIntoClient
191-
public consuming func consumingFlatMap<NewSuccess: ~Copyable>(
194+
public consuming func _consumingFlatMap<NewSuccess: ~Copyable>(
192195
_ transform: (consuming Success) -> Result<NewSuccess, Failure>
193196
) -> Result<NewSuccess, Failure> {
194197
switch consume self {
@@ -200,8 +203,9 @@ extension Result where Success: ~Copyable {
200203
}
201204

202205
#if $BorrowingSwitch
206+
// FIXME(NCG): Make this public.
203207
@_alwaysEmitIntoClient
204-
public borrowing func borrowingFlatMap<NewSuccess: ~Copyable>(
208+
public borrowing func _borrowingFlatMap<NewSuccess: ~Copyable>(
205209
_ transform: (borrowing Success) -> Result<NewSuccess, Failure>
206210
) -> Result<NewSuccess, Failure> {
207211
switch self {

0 commit comments

Comments
 (0)