File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1133,6 +1133,7 @@ extension Unsafe${Mutable}RawBufferPointer {
11331133 public func withContiguousMutableStorageIfAvailable< R> (
11341134 _ body: ( inout UnsafeMutableBufferPointer < Element > ) throws -> R
11351135 ) rethrows -> R ? {
1136+ #if $TypedThrows
11361137 try withMemoryRebound ( to: Element . self) { b in
11371138 var buffer = b
11381139 defer {
@@ -1143,6 +1144,9 @@ extension Unsafe${Mutable}RawBufferPointer {
11431144 }
11441145 return try body ( & buffer)
11451146 }
1147+ #else
1148+ fatalError ( " unsupported compiler " )
1149+ #endif
11461150 }
11471151
11481152% end
@@ -1151,9 +1155,13 @@ extension Unsafe${Mutable}RawBufferPointer {
11511155 public func withContiguousStorageIfAvailable< R> (
11521156 _ body: ( UnsafeBufferPointer < Element > ) throws -> R
11531157 ) rethrows -> R ? {
1158+ #if $TypedThrows
11541159 try withMemoryRebound ( to: Element . self) {
11551160 try body( ${ 'UnsafeBufferPointer < Element > ( $0) ' if Mutable else '$0' } )
11561161 }
1162+ #else
1163+ fatalError ( " unsupported compiler " )
1164+ #endif
11571165 }
11581166}
11591167
You can’t perform that action at this time.
0 commit comments