Skip to content

Commit fe59764

Browse files
committed
Make Unsafe[Mutable]BufferPointer conform to BitwiseCopyable.
The Span interface requires this. It needs to be able to create dependencies on UBP values without creating extra temporary copies. This is only a temporary workaround for: rdar://140291657 (ASTPrinter: print synthesized conformances on the type definition, not as an extension) Until that ASTPrinter bug is fixed, .swiftinterface files drop BitwiseCopyable conformance on types that have conditionally ~Copyable generic parameters.
1 parent d7806eb commit fe59764

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/core/UnsafeBufferPointer.swift.gyb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ public struct Unsafe${Mutable}BufferPointer<Element: ~Copyable>: Copyable {
110110
% end
111111
}
112112

113+
// FIXME: The ASTPrinter should print this synthesized conformance.
114+
// rdar://140291657
115+
extension Unsafe${Mutable}BufferPointer: BitwiseCopyable where Element: ~Copyable {}
116+
113117
@available(*, unavailable)
114118
extension Unsafe${Mutable}BufferPointer: Sendable where Element: ~Copyable {}
115119

0 commit comments

Comments
 (0)