Skip to content

Commit 819ef4f

Browse files
committed
[stdlib] state clearly the precondition of loadUnaligned
1 parent 86089dc commit 819ef4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stdlib/public/core/UnsafeRawPointer.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ public struct UnsafeRawPointer: _Pointer {
436436
/// Returns a new instance of the given type, constructed from the raw memory
437437
/// at the specified offset.
438438
///
439-
/// This function only supports loading trivial types.
439+
/// This function only supports loading trivial types,
440+
/// and will trap if this precondition is not met.
440441
/// A trivial type does not contain any reference-counted property
441442
/// within its in-memory representation.
442443
/// The memory at this pointer plus `offset` must be laid out
@@ -1160,7 +1161,8 @@ public struct UnsafeMutableRawPointer: _Pointer {
11601161
/// Returns a new instance of the given type, constructed from the raw memory
11611162
/// at the specified offset.
11621163
///
1163-
/// This function only supports loading trivial types.
1164+
/// This function only supports loading trivial types,
1165+
/// and will trap if this precondition is not met.
11641166
/// A trivial type does not contain any reference-counted property
11651167
/// within its in-memory representation.
11661168
/// The memory at this pointer plus `offset` must be laid out

0 commit comments

Comments
 (0)