@@ -213,20 +213,22 @@ extension Optional where Wrapped: ~Copyable {
213213 }
214214 }
215215
216- #if hasFeature(BorrowingSwitch)
217216 // FIXME(NCG): Make this public.
218217 @_alwaysEmitIntoClient
219218 public borrowing func _borrowingMap< U: ~ Copyable, E: Error > (
220219 _ transform: ( borrowing Wrapped ) throws ( E ) -> U
221220 ) throws ( E) -> U ? {
221+ #if $NoncopyableGenerics
222222 switch self {
223223 case . some( _borrowing y) :
224224 return . some( try transform ( y) )
225225 case . none:
226226 return . none
227227 }
228+ #else
229+ fatalError ( " unsupported compiler " )
230+ #endif
228231 }
229- #endif
230232}
231233
232234extension Optional {
@@ -263,6 +265,7 @@ extension Optional {
263265 }
264266}
265267
268+ @_disallowFeatureSuppression ( NoncopyableGenerics)
266269extension Optional where Wrapped: ~ Copyable {
267270 // FIXME(NCG): Make this public.
268271 @_alwaysEmitIntoClient
@@ -277,7 +280,6 @@ extension Optional where Wrapped: ~Copyable {
277280 }
278281 }
279282
280- #if hasFeature(BorrowingSwitch)
281283 // FIXME(NCG): Make this public.
282284 @_alwaysEmitIntoClient
283285 public func _borrowingFlatMap< U: ~ Copyable, E: Error > (
@@ -290,7 +292,6 @@ extension Optional where Wrapped: ~Copyable {
290292 return . none
291293 }
292294 }
293- #endif
294295}
295296
296297extension Optional {
@@ -546,7 +547,6 @@ public struct _OptionalNilComparisonType: ExpressibleByNilLiteral {
546547 }
547548}
548549
549- #if hasFeature(BorrowingSwitch)
550550extension Optional where Wrapped: ~ Copyable {
551551 /// Returns a Boolean value indicating whether an argument matches `nil`.
552552 ///
@@ -735,9 +735,6 @@ extension Optional where Wrapped: ~Copyable {
735735 }
736736 }
737737}
738- #else
739- #error("FIXME(NCG): Fill this out.")
740- #endif
741738
742739/// Performs a nil-coalescing operation, returning the wrapped value of an
743740/// `Optional` instance or a default value.
0 commit comments