We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 911fbb6 commit 1125f75Copy full SHA for 1125f75
test/stdlib/Span/SpanTests.swift
@@ -589,3 +589,20 @@ suite.test("initialize from raw memory")
589
let first = test(span)
590
expectEqual(first, 0x07060504)
591
}
592
+
593
+private func send(_: some Sendable & ~Escapable) {}
594
595
+private struct NCSendable: ~Copyable, Sendable {}
596
597
+suite.test("Span Sendability")
598
+.require(.stdlib_6_2).code {
599
+ guard #available(SwiftStdlib 6.2, *) else { return }
600
601
+ let buffer = UnsafeMutableBufferPointer<NCSendable>.allocate(capacity: 1)
602
+ defer { buffer.deallocate() }
603
+ buffer.initializeElement(at: 0, to: NCSendable())
604
+ defer { buffer.deinitialize() }
605
606
+ let span = Span(_unsafeElements: buffer)
607
+ send(span)
608
+}
0 commit comments