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 b3f2f00 commit bd237c7Copy full SHA for bd237c7
test/Unsafe/safe.swift
@@ -168,6 +168,9 @@ extension UnsafeBufferPointer {
168
169
func testMyArray(ints: MyArray<Int>) {
170
ints.withUnsafeBufferPointer { buffer in
171
+ let bufferCopy = unsafe buffer
172
+ _ = unsafe bufferCopy
173
+
174
// expected-warning@+1{{expression uses unsafe constructs but is not marked with 'unsafe'}}
175
print(buffer.safeCount) // expected-note{{reference to parameter 'buffer' involves unsafe type 'UnsafeBufferPointer<Int>'}}
176
unsafe print(buffer.baseAddress!)
0 commit comments