Skip to content

Commit fefab49

Browse files
committed
[stdlib] Suppress MemoryLayout : _BitwiseCopyable.
Mark it always unavailable per LWG feedback.
1 parent ec0f856 commit fefab49

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

stdlib/public/core/MemoryLayout.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public enum MemoryLayout<T> {
7676
}
7777
}
7878

79+
@available(*, unavailable)
80+
extension MemoryLayout : _BitwiseCopyable {}
81+
7982
extension MemoryLayout {
8083
/// Returns the contiguous memory footprint of the given instance.
8184
///

test/Sema/bitwise_copyable_2.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-typecheck-verify-swift \
2-
// RUN: -disable-availability-checking \
32
// RUN: -enable-experimental-feature NonescapableTypes \
43
// RUN: -enable-experimental-feature BitwiseCopyable \
54
// RUN: -enable-builtin-module \
@@ -35,3 +34,5 @@ func take<T : _BitwiseCopyable>(_ t: T) {}
3534

3635
func passInternalUsableStruct(_ s: InternalUsableStruct) { take(s) } // expected-error{{type_does_not_conform_decl_owner}}
3736
// expected-note@-8{{where_requirement_failure_one_subst}}
37+
38+
func passMemoryLayout<T>(_ m: MemoryLayout<T>) { take(m) } // expected-error{{conformance_availability_unavailable}}

0 commit comments

Comments
 (0)