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 {
1133
1133
public func withContiguousMutableStorageIfAvailable< R> (
1134
1134
_ body: ( inout UnsafeMutableBufferPointer < Element > ) throws -> R
1135
1135
) rethrows -> R ? {
1136
+ #if $TypedThrows
1136
1137
try withMemoryRebound ( to: Element . self) { b in
1137
1138
var buffer = b
1138
1139
defer {
@@ -1143,6 +1144,9 @@ extension Unsafe${Mutable}RawBufferPointer {
1143
1144
}
1144
1145
return try body ( & buffer)
1145
1146
}
1147
+ #else
1148
+ fatalError ( " unsupported compiler " )
1149
+ #endif
1146
1150
}
1147
1151
1148
1152
% end
@@ -1151,9 +1155,13 @@ extension Unsafe${Mutable}RawBufferPointer {
1151
1155
public func withContiguousStorageIfAvailable< R> (
1152
1156
_ body: ( UnsafeBufferPointer < Element > ) throws -> R
1153
1157
) rethrows -> R ? {
1158
+ #if $TypedThrows
1154
1159
try withMemoryRebound ( to: Element . self) {
1155
1160
try body( ${ 'UnsafeBufferPointer < Element > ( $0) ' if Mutable else '$0' } )
1156
1161
}
1162
+ #else
1163
+ fatalError ( " unsupported compiler " )
1164
+ #endif
1157
1165
}
1158
1166
}
1159
1167
You can’t perform that action at this time.
0 commit comments