Skip to content

Commit cbe582f

Browse files
committed
Add a unit test for lifetime dependence
1 parent b835c14 commit cbe582f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/Sema/explicit_lifetime_dependence_specifiers2.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ struct AnotherBufferView : ~Escapable, _BitwiseCopyable {
1212

1313
struct BufferView : ~Escapable {
1414
let ptr: UnsafeRawBufferPointer
15-
init(_ bv: borrowing AnotherBufferView) -> _borrow(bv) Self {
15+
init(_ bv: borrowing AnotherBufferView) -> dependsOn(bv) Self {
1616
self.ptr = bv.ptr
1717
return self
1818
}
1919
}
2020

21+
struct NonescapableType: ~Escapable {}
22+
23+
func f<T: ~Escapable & _BitwiseCopyable>(arg: T) -> NonescapableType {
24+
NonescapableType()
25+
}

0 commit comments

Comments
 (0)