Skip to content

Commit a9a7c8a

Browse files
committed
[test] check non-sendability of ManagedBuffer[Pointer]
1 parent f9eb322 commit a9a7c8a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/Concurrency/sendable_checking.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,12 @@ func testPointersAreNotSendable() {
387387
testSendable(rawMutableBuffer) // expected-warning {{conformance of 'UnsafeMutableRawBufferPointer' to 'Sendable' is unavailable}}
388388
testSendable(rawMutableBuffer.makeIterator()) // expected-warning {{conformance of 'UnsafeRawBufferPointer.Iterator' to 'Sendable' is unavailable}}
389389
}
390+
391+
func testManagedBuffers(buffer1: ManagedBuffer<Int, Int>, buffer2: ManagedBufferPointer<Int, Int>) {
392+
testSendable(buffer1) // expected-warning {{conformance of 'ManagedBuffer<Header, Element>' to 'Sendable' is unavailable}}
393+
394+
testSendable(buffer2) // expected-warning {{conformance of 'ManagedBufferPointer<Header, Element>' to 'Sendable' is unavailable}}
395+
}
390396
}
391397

392398
@available(*, unavailable)

0 commit comments

Comments
 (0)