@@ -1228,7 +1228,7 @@ extension ${Self} {
1228
1228
/// of the closure's execution.
1229
1229
/// - Returns: The return value, if any, of the `body` closure.
1230
1230
@_alwaysEmitIntoClient
1231
- public func withUnsafeMutableBytes< T, E: Error , Result> (
1231
+ public func withUnsafeMutableBytes< T: ~ Copyable , E: Error , Result: ~ Copyable > (
1232
1232
of value: inout T ,
1233
1233
_ body: ( UnsafeMutableRawBufferPointer ) throws ( E ) -> Result
1234
1234
) throws ( E) -> Result {
@@ -1238,6 +1238,7 @@ public func withUnsafeMutableBytes<T, E: Error, Result>(
1238
1238
1239
1239
/// ABI: Historical withUnsafeMutableBytes(of:_:) rethrows,
1240
1240
/// expressed as "throws", which is ABI-compatible with "rethrows".
1241
+ @_spi ( SwiftStdlibLegacyABI) @available ( swift, obsoleted: 2 )
1241
1242
@_silgen_name ( " $ss22withUnsafeMutableBytes2of_q_xz_q_SwKXEtKr0_lF " )
1242
1243
@usableFromInline
1243
1244
func __abi_se0413_withUnsafeMutableBytes< T, Result> (
@@ -1256,7 +1257,9 @@ func __abi_se0413_withUnsafeMutableBytes<T, Result>(
1256
1257
/// This function is similar to `withUnsafeMutableBytes`, except that it
1257
1258
/// doesn't trigger stack protection for the pointer.
1258
1259
@_alwaysEmitIntoClient
1259
- public func _withUnprotectedUnsafeMutableBytes< T, E: Error , Result> (
1260
+ public func _withUnprotectedUnsafeMutableBytes<
1261
+ T: ~ Copyable, E: Error , Result: ~ Copyable
1262
+ > (
1260
1263
of value: inout T ,
1261
1264
_ body: ( UnsafeMutableRawBufferPointer ) throws ( E ) -> Result
1262
1265
) throws ( E) -> Result {
@@ -1292,7 +1295,7 @@ public func _withUnprotectedUnsafeMutableBytes<T, E: Error, Result>(
1292
1295
/// `withUnsafeMutableBytes(of:_:)` instead.
1293
1296
/// - Returns: The return value, if any, of the `body` closure.
1294
1297
@_alwaysEmitIntoClient
1295
- public func withUnsafeBytes< T, E: Error , Result> (
1298
+ public func withUnsafeBytes< T: ~ Copyable , E: Error , Result: ~ Copyable > (
1296
1299
of value: inout T ,
1297
1300
_ body: ( UnsafeRawBufferPointer ) throws ( E ) -> Result
1298
1301
) throws ( E) -> Result {
@@ -1302,6 +1305,7 @@ public func withUnsafeBytes<T, E: Error, Result>(
1302
1305
1303
1306
/// ABI: Historical withUnsafeBytes(of:_:) rethrows,
1304
1307
/// expressed as "throws", which is ABI-compatible with "rethrows".
1308
+ @_spi ( SwiftStdlibLegacyABI) @available ( swift, obsoleted: 2 )
1305
1309
@_silgen_name ( " $ss15withUnsafeBytes2of_q_xz_q_SWKXEtKr0_lF " )
1306
1310
@usableFromInline
1307
1311
func __abi_se0413_withUnsafeBytes< T, Result> (
@@ -1319,7 +1323,9 @@ func __abi_se0413_withUnsafeBytes<T, Result>(
1319
1323
/// This function is similar to `withUnsafeBytes`, except that it
1320
1324
/// doesn't trigger stack protection for the pointer.
1321
1325
@_alwaysEmitIntoClient
1322
- public func _withUnprotectedUnsafeBytes< T, E: Error , Result> (
1326
+ public func _withUnprotectedUnsafeBytes<
1327
+ T: ~ Copyable, E: Error , Result: ~ Copyable
1328
+ > (
1323
1329
of value: inout T ,
1324
1330
_ body: ( UnsafeRawBufferPointer ) throws ( E ) -> Result
1325
1331
) throws ( E) -> Result {
@@ -1351,8 +1357,10 @@ public func _withUnprotectedUnsafeBytes<T, E: Error, Result>(
1351
1357
/// `withUnsafeMutableBytes(of:_:)` instead.
1352
1358
/// - Returns: The return value, if any, of the `body` closure.
1353
1359
@_alwaysEmitIntoClient
1354
- public func withUnsafeBytes< T, E: Error , Result> (
1355
- of value: T ,
1360
+ public func withUnsafeBytes<
1361
+ T: ~ Copyable, E: Error , Result: ~ Copyable
1362
+ > (
1363
+ of value: borrowing T ,
1356
1364
_ body: ( UnsafeRawBufferPointer ) throws ( E ) -> Result
1357
1365
) throws ( E) -> Result {
1358
1366
let addr = UnsafeRawPointer ( Builtin . addressOfBorrow ( value) )
@@ -1361,6 +1369,7 @@ public func withUnsafeBytes<T, E: Error, Result>(
1361
1369
1362
1370
/// ABI: Historical withUnsafeBytes(of:_:) rethrows,
1363
1371
/// expressed as "throws", which is ABI-compatible with "rethrows".
1372
+ @_spi ( SwiftStdlibLegacyABI) @available ( swift, obsoleted: 2 )
1364
1373
@_silgen_name ( " $ss15withUnsafeBytes2of_q_x_q_SWKXEtKr0_lF " )
1365
1374
@usableFromInline
1366
1375
func __abi_se0413_withUnsafeBytes< T, Result> (
@@ -1378,8 +1387,10 @@ func __abi_se0413_withUnsafeBytes<T, Result>(
1378
1387
/// This function is similar to `withUnsafeBytes`, except that it
1379
1388
/// doesn't trigger stack protection for the pointer.
1380
1389
@_alwaysEmitIntoClient
1381
- public func _withUnprotectedUnsafeBytes< T, E: Error , Result> (
1382
- of value: T ,
1390
+ public func _withUnprotectedUnsafeBytes<
1391
+ T: ~ Copyable, E: Error , Result: ~ Copyable
1392
+ > (
1393
+ of value: borrowing T ,
1383
1394
_ body: ( UnsafeRawBufferPointer ) throws ( E ) -> Result
1384
1395
) throws ( E) -> Result {
1385
1396
#if $BuiltinUnprotectedAddressOf
0 commit comments