Update Sources/Atomics/AtomicOptionalRawRepresentable.swift

state the layout compatibility guarantee

Co-authored-by: Karoy Lorentey <klorentey@apple.com>
This commit is contained in:
Guillaume LessardandKaroy Lorentey authored and GitHub committed 2021-09-20 17:41:16 -06:00
1 parent ae5e639014
commit e47d14acfb
1 file changed
+1
@@ -44,6 +44,7 @@ public struct AtomicOptionalRawRepresentableStorage<Wrapped>: AtomicStorage
static func _extract(
_ ptr: UnsafeMutablePointer<Self>
) -> UnsafeMutablePointer<Storage> {
// `Self` is layout-compatible with its only stored property.
return UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: Storage.self)
}