Skip to content

Commit db92d2b

Browse files
committed
[stdlib] Generalize MemoryLayout for ~Escapable types
1 parent 815c3e8 commit db92d2b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stdlib/public/core/MemoryLayout.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@
4040
/// byteCount: count * MemoryLayout<Point>.stride,
4141
/// alignment: MemoryLayout<Point>.alignment)
4242
@frozen // namespace
43-
public enum MemoryLayout<T: ~Copyable>: ~BitwiseCopyable, Copyable {}
43+
public enum MemoryLayout<T: ~Copyable & ~Escapable>
44+
: ~BitwiseCopyable, Copyable, Escapable {}
4445

45-
extension MemoryLayout where T: ~Copyable {
46+
extension MemoryLayout where T: ~Copyable & ~Escapable {
4647
/// The contiguous memory footprint of `T`, in bytes.
4748
///
4849
/// A type's size does not include any dynamically allocated or out of line
@@ -81,7 +82,7 @@ extension MemoryLayout where T: ~Copyable {
8182
}
8283
}
8384

84-
extension MemoryLayout where T: ~Copyable {
85+
extension MemoryLayout where T: ~Copyable & ~Escapable {
8586
/// Returns the contiguous memory footprint of the given instance.
8687
///
8788
/// The result does not include any dynamically allocated or out of line

0 commit comments

Comments
 (0)