@@ -517,7 +517,10 @@ extension UnsafeRawPointer {
517
517
fromByteOffset offset: Int = 0 ,
518
518
as type: T . Type
519
519
) -> T {
520
- _debugPrecondition ( _isPOD ( T . self) )
520
+ _debugPrecondition (
521
+ _isPOD ( T . self) ,
522
+ " loadUnaligned only supports loading BitwiseCopyable types. "
523
+ )
521
524
return _withUnprotectedUnsafeTemporaryAllocation ( of: T . self, capacity: 1 ) {
522
525
let temporary = $0. baseAddress. _unsafelyUnwrappedUnchecked
523
526
Builtin . int_memcpy_RawPointer_RawPointer_Int64 (
@@ -1351,7 +1354,10 @@ extension UnsafeMutableRawPointer {
1351
1354
fromByteOffset offset: Int = 0 ,
1352
1355
as type: T . Type
1353
1356
) -> T {
1354
- _debugPrecondition ( _isPOD ( T . self) )
1357
+ _debugPrecondition (
1358
+ _isPOD ( T . self) ,
1359
+ " loadUnaligned only supports loading BitwiseCopyable types. "
1360
+ )
1355
1361
return _withUnprotectedUnsafeTemporaryAllocation ( of: T . self, capacity: 1 ) {
1356
1362
let temporary = $0. baseAddress. _unsafelyUnwrappedUnchecked
1357
1363
Builtin . int_memcpy_RawPointer_RawPointer_Int64 (
@@ -1456,7 +1462,10 @@ extension UnsafeMutableRawPointer {
1456
1462
public func storeBytes< T> (
1457
1463
of value: T , toByteOffset offset: Int = 0 , as type: T . Type
1458
1464
) {
1459
- _debugPrecondition ( _isPOD ( T . self) )
1465
+ _debugPrecondition (
1466
+ _isPOD ( T . self) ,
1467
+ " storeBytes only supports storing the bytes of BitwiseCopyable types. "
1468
+ )
1460
1469
1461
1470
#if $TypedThrows
1462
1471
withUnsafePointer ( to: value) { source in
0 commit comments