We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5fa3ed commit 073d545Copy full SHA for 073d545
test/stdlib/Span/MutableSpanTests.swift
@@ -630,3 +630,18 @@ suite.test("MutableSpan from UnsafeMutableBufferPointer")
630
631
expectTrue(b.elementsEqual((0..<capacity).reversed()))
632
}
633
+
634
+private func send(_: borrowing some Sendable & ~Copyable & ~Escapable) {}
635
636
+private struct NCSendable: ~Copyable, Sendable {}
637
638
+suite.test("MutableSpan Sendability")
639
+.require(.stdlib_6_2).code {
640
+ let buffer = UnsafeMutableBufferPointer<NCSendable>.allocate(capacity: 1)
641
+ defer { buffer.deallocate() }
642
+ buffer.initializeElement(at: 0, to: NCSendable())
643
+ defer { buffer.deinitialize() }
644
645
+ let span = MutableSpan(_unsafeElements: buffer)
646
+ send(span)
647
+}
0 commit comments