Skip to content

Commit f5637fc

Browse files
committed
Update tests for strict @Lifetime type checking
1 parent 37ca663 commit f5637fc

File tree

53 files changed

+231
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+231
-139
lines changed

test/ASTGen/attrs.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ struct OpTest {
219219

220220
struct E {}
221221
struct NE : ~Escapable {}
222-
@lifetime(ne) func derive(_ ne: NE) -> NE { ne }
223-
@lifetime(borrow ne1, ne2) func derive(_ ne1: NE, _ ne2: NE) -> NE {
222+
@lifetime(copy ne) func derive(_ ne: NE) -> NE { ne }
223+
@lifetime(borrow ne1, copy ne2) func derive(_ ne1: NE, _ ne2: NE) -> NE {
224224
if (Int.random(in: 1..<100) < 50) { return ne1 }
225225
return ne2
226226
}
227227
@lifetime(borrow borrow) func testNameConflict(_ borrow: E) -> NE { NE() }
228-
@lifetime(result: source) func testTarget(_ result: inout NE, _ source: consuming NE) { result = source }
228+
@lifetime(result: copy source) func testTarget(_ result: inout NE, _ source: consuming NE) { result = source }
229229

230230
actor MyActor {
231231
nonisolated let constFlag: Bool = false

test/Generics/inverse_casting_availability.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// RUN: %target-typecheck-verify-swift \
2+
// RUN: -enable-experimental-feature LifetimeDependence \
23
// RUN: -debug-diagnostic-names -target arm64-apple-macos14.4
34

5+
// REQUIRES: swift_feature_LifetimeDependence
6+
47
// REQUIRES: OS=macosx || OS=ios || OS=tvos || OS=watchOS || OS=xros
58

69
protocol P {}

test/Generics/inverse_conditional_conformance_copyable_and_escapable.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// RUN: %target-swift-frontend -typecheck -verify %s
1+
// RUN: %target-swift-frontend \
2+
// RUN: -enable-experimental-feature LifetimeDependence \
3+
// RUN: -typecheck -verify %s
4+
5+
// REQUIRES: swift_feature_LifetimeDependence
26

37
struct C_C1<T: ~Copyable>: ~Copyable {}
48
extension C_C1: Copyable where T: Copyable {}

test/Generics/inverse_conditional_conformance_restriction.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %target-typecheck-verify-swift \
2+
// RUN: -enable-experimental-feature LifetimeDependence \
23
// RUN: -enable-experimental-feature SuppressedAssociatedTypes
34

5+
// REQUIRES: swift_feature_LifetimeDependence
46
// REQUIRES: swift_feature_SuppressedAssociatedTypes
57

68
protocol P {}

test/Generics/inverse_extension_signatures.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// RUN: %target-swift-frontend \
2+
// RUN: -enable-experimental-feature LifetimeDependence \
23
// RUN: -verify -typecheck %s -debug-generic-signatures \
34
// RUN: -debug-inverse-requirements 2>&1 | %FileCheck %s --implicit-check-not "error:"
45

6+
// REQUIRES: swift_feature_LifetimeDependence
57

68
// CHECK-LABEL: .Outer@
79
// CHECK: Generic signature: <A where A : Escapable>

test/Generics/inverse_generics.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ struct BuggerView<T: ~Copyable>: ~Escapable, Copyable {}
249249

250250
struct MutableBuggerView<T: ~Copyable>: ~Copyable, ~Escapable {}
251251

252+
@lifetime(mutRef: copy mutRef)
252253
func checkNominals(_ mutRef: inout MutableBuggerView<NC>,
253254
_ ref: BuggerView<NC>,
254255
_ intMutRef: borrowing MutableBuggerView<Int>,

test/Interop/C/swiftify-import/counted-by-noescape.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import CountedByNoEscapeClang
1414
// CHECK: @_alwaysEmitIntoClient public func complexExpr(_ len: Int{{.*}}, _ offset: Int{{.*}}, _ p: MutableSpan<Int{{.*}}>)
1515
// CHECK-NEXT: @_alwaysEmitIntoClient public func nonnull(_ p: MutableSpan<Int{{.*}}>)
1616
// CHECK-NEXT: @_alwaysEmitIntoClient public func nullUnspecified(_ p: MutableSpan<Int{{.*}}>)
17-
// CHECK-NEXT: @lifetime(p)
17+
// CHECK-NEXT: @lifetime(copy p)
1818
// CHECK-NEXT: @_alwaysEmitIntoClient public func returnLifetimeBound(_ len1: Int32, _ p: MutableSpan<Int32>) -> MutableSpan<Int32>
1919
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnPointer(_ len: Int{{.*}}) -> UnsafeMutableBufferPointer<Int{{.*}}>
2020
// CHECK-NEXT: @_alwaysEmitIntoClient public func shared(_ len: Int{{.*}}, _ p1: MutableSpan<Int{{.*}}>, _ p2: MutableSpan<Int{{.*}}>)

test/Interop/Cxx/class/safe-interop-mode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module Test {
2121
struct SWIFT_NONESCAPABLE View {
2222
__attribute__((swift_attr("@lifetime(immortal)")))
2323
View() : member(nullptr) {}
24-
__attribute__((swift_attr("@lifetime(p)")))
24+
__attribute__((swift_attr("@lifetime(copy p)")))
2525
View(const int *p [[clang::lifetimebound]]) : member(p) {}
2626
View(const View&) = default;
2727
private:

test/Interop/Cxx/stdlib/std-span-interface.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ import CxxStdlib
3535
// CHECK-NEXT: mutating func foo(_ s: std.{{.*}}span<__cxxConst<CInt>, _C{{.*}}_{{.*}}>)
3636
// CHECK-NEXT: }
3737
// CHECK: @_alwaysEmitIntoClient public func funcWithSafeWrapper(_ s: Span<CInt>)
38-
// CHECK-NEXT: @lifetime(s)
38+
// CHECK-NEXT: @lifetime(copy s)
3939
// CHECK-NEXT: @_alwaysEmitIntoClient public func funcWithSafeWrapper2(_ s: Span<CInt>) -> Span<CInt>
4040
// CHECK-NEXT: @lifetime(borrow v)
4141
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func funcWithSafeWrapper3(_ v: borrowing VecOfInt) -> Span<CInt>
42-
// CHECK-NEXT: @lifetime(p)
42+
// CHECK-NEXT: @lifetime(copy p)
4343
// CHECK-NEXT: @_alwaysEmitIntoClient public func mixedFuncWithSafeWrapper1(_ p: Span<Int32>) -> Span<CInt>
4444
// CHECK-NEXT: @lifetime(borrow v)
4545
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func mixedFuncWithSafeWrapper2(_ v: borrowing VecOfInt, _ len: Int32) -> Span<Int32>

test/Macros/SwiftifyImport/CountedBy/PointerReturn.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func lifetimeDependentBorrow(_ p: borrowing UnsafePointer<CInt>, _ len1: CInt, _
2828
// CHECK-NEXT: func nonEscaping(_ len: CInt) -> UnsafeBufferPointer<CInt> {
2929
// CHECK-NEXT: return unsafe UnsafeBufferPointer<CInt> (start: nonEscaping(len), count: Int(len))
3030

31-
// CHECK: @_alwaysEmitIntoClient @lifetime(p)
31+
// CHECK: @_alwaysEmitIntoClient @lifetime(copy p)
3232
// CHECK-NEXT: func lifetimeDependentCopy(_ p: Span<CInt>, _ len2: CInt) -> Span<CInt> {
3333
// CHECK-NEXT: return unsafe Span<CInt> (_unsafeStart: p.withUnsafeBufferPointer { _pPtr in
3434
// CHECK-NEXT: return unsafe lifetimeDependentCopy(_pPtr.baseAddress!, CInt(exactly: p.count)!, len2)

test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct X {
3232
func myFunc5() -> SpanOfInt {}
3333
}
3434

35-
// CHECK: @_alwaysEmitIntoClient @lifetime(span)
35+
// CHECK: @_alwaysEmitIntoClient @lifetime(copy span)
3636
// CHECK-NEXT: func myFunc(_ span: Span<CInt>) -> Span<CInt> {
3737
// CHECK-NEXT: return unsafe _unsafeRemoveLifetime(Span(_unsafeCxxSpan: myFunc(SpanOfInt(span))))
3838
// CHECK-NEXT: }
@@ -42,12 +42,12 @@ struct X {
4242
// CHECK-NEXT: return unsafe _unsafeRemoveLifetime(Span(_unsafeCxxSpan: myFunc2(vec)))
4343
// CHECK-NEXT: }
4444

45-
// CHECK: @_alwaysEmitIntoClient @lifetime(span1, span2)
45+
// CHECK: @_alwaysEmitIntoClient @lifetime(copy span1, copy span2)
4646
// CHECK-NEXT: func myFunc3(_ span1: Span<CInt>, _ span2: Span<CInt>) -> Span<CInt> {
4747
// CHECK-NEXT: return unsafe _unsafeRemoveLifetime(Span(_unsafeCxxSpan: myFunc3(SpanOfInt(span1), SpanOfInt(span2))))
4848
// CHECK-NEXT: }
4949

50-
// CHECK: @_alwaysEmitIntoClient @lifetime(borrow vec, span)
50+
// CHECK: @_alwaysEmitIntoClient @lifetime(borrow vec, copy span)
5151
// CHECK-NEXT: func myFunc4(_ vec: borrowing VecOfInt, _ span: Span<CInt>) -> Span<CInt> {
5252
// CHECK-NEXT: return unsafe _unsafeRemoveLifetime(Span(_unsafeCxxSpan: myFunc4(vec, SpanOfInt(span))))
5353
// CHECK-NEXT: }

test/ModuleInterface/Inputs/lifetime_dependence.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal func _overrideLifetime<T: ~Copyable & ~Escapable, U: ~Copyable & ~Escap
1010
@_unsafeNonescapableResult
1111
@_alwaysEmitIntoClient
1212
@_transparent
13-
@lifetime(source)
13+
@lifetime(copy source)
1414
internal func _overrideLifetime<T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable>(
1515
_ dependent: consuming T, copying source: borrowing U) -> T {
1616
dependent
@@ -43,15 +43,15 @@ public struct BufferView : ~Escapable {
4343
self = _overrideLifetime(bv, borrowing: a)
4444
}
4545
@inlinable
46-
@lifetime(a)
46+
@lifetime(copy a)
4747
internal init(_ ptr: UnsafeRawBufferPointer, _ a: consuming AnotherView) {
4848
let bv = BufferView(ptr, a._count)
4949
self = _overrideLifetime(bv, copying: a)
5050
}
5151
}
5252

5353
@inlinable
54-
@lifetime(x)
54+
@lifetime(copy x)
5555
public func derive(_ x: consuming BufferView) -> BufferView {
5656
let pointer = x._ptr
5757
let bv = BufferView(pointer, x._count)
@@ -62,15 +62,15 @@ public func derive(_ x: consuming BufferView) -> BufferView {
6262
public func use(_ x: consuming BufferView) {}
6363

6464
@inlinable
65-
@lifetime(view)
65+
@lifetime(copy view)
6666
public func consumeAndCreate(_ view: consuming BufferView) -> BufferView {
6767
let pointer = view._ptr
6868
let bv = BufferView(pointer, view._count)
6969
return _overrideLifetime(bv, copying: view)
7070
}
7171

7272
@inlinable
73-
@lifetime(this, that)
73+
@lifetime(copy this, copy that)
7474
public func deriveThisOrThat(_ this: consuming BufferView, _ that: consuming BufferView) -> BufferView {
7575
if (Int.random(in: 1..<100) == 0) {
7676
return BufferView(this._ptr, this._count)

test/ModuleInterface/lifetime_dependence_test.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
import lifetime_dependence
2525
// CHECK: @lifetime(borrow a)
2626
// CHECK-NEXT: @inlinable internal init(_ ptr: Swift.UnsafeRawBufferPointer, _ a: borrowing Swift.Array<Swift.Int>) {
27-
// CHECK: @lifetime(a)
27+
// CHECK: @lifetime(copy a)
2828
// CHECK-NEXT: @inlinable internal init(_ ptr: Swift.UnsafeRawBufferPointer, _ a: consuming lifetime_dependence.AnotherView) {
2929

30-
// CHECK: @lifetime(x)
30+
// CHECK: @lifetime(copy x)
3131
// CHECK-NEXT: @inlinable public func derive(_ x: consuming lifetime_dependence.BufferView) -> lifetime_dependence.BufferView {
3232

33-
// CHECK: @lifetime(view)
33+
// CHECK: @lifetime(copy view)
3434
// CHECK-NEXT: @inlinable public func consumeAndCreate(_ view: consuming lifetime_dependence.BufferView) -> lifetime_dependence.BufferView {
3535

36-
// CHECK: @lifetime(this, that)
36+
// CHECK: @lifetime(copy this, copy that)
3737
// CHECK-NEXT: @inlinable public func deriveThisOrThat(_ this: consuming lifetime_dependence.BufferView, _ that: consuming lifetime_dependence.BufferView) -> lifetime_dependence.BufferView {
3838

3939
// Check that an implicitly dependent variable accessor is guarded by LifetimeDependence.

test/ModuleInterface/nonescapable_types.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ public enum Y<T: ~Escapable>: ~Escapable {
5050
extension Y: Escapable where T: Escapable { }
5151

5252
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
53-
// CHECK: @lifetime(y)
53+
// CHECK: @lifetime(copy y)
5454
// CHECK: public func derive<T>(_ y: Test.Y<T>) -> Test.Y<T> where T : ~Escapable
5555
// CHECK: #endif
56-
@lifetime(y)
56+
@lifetime(copy y)
5757
public func derive<T : ~Escapable>(_ y: Y<T>) -> Y<T> {
5858
y
5959
}
6060

6161
// CHECK: #if compiler(>=5.3) && $NonescapableTypes
62-
// CHECK: @lifetime(x)
62+
// CHECK: @lifetime(copy x)
6363
// CHECK: public func derive<T>(_ x: Test.X<T>) -> Test.X<T> where T : ~Escapable
6464
// CHECK: #endif
65-
@lifetime(x)
65+
@lifetime(copy x)
6666
public func derive<T : ~Escapable>(_ x: X<T>) -> X<T> {
6767
x
6868
}

test/Parse/inverse_escapable_feature.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
// RUN: %target-typecheck-verify-swift
1+
// RUN: %target-typecheck-verify-swift \
2+
// RUN: -enable-experimental-feature LifetimeDependence
3+
4+
// REQUIRES: swift_feature_LifetimeDependence
25

36
struct S: ~Escapable {}
47

test/Parse/lifetime_attr.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ struct E {}
66

77
struct NE : ~Escapable {}
88

9-
@lifetime(ne)
9+
@lifetime(copy ne)
1010
func derive(_ ne: NE) -> NE {
1111
ne
1212
}
1313

14-
@lifetime(borrow ne1, ne2)
14+
@lifetime(borrow ne1, copy ne2)
1515
func derive(_ ne1: NE, _ ne2: NE) -> NE {
1616
if (Int.random(in: 1..<100) < 50) {
1717
return ne1
1818
}
1919
return ne2
2020
}
2121

22-
@lifetime // expected-error{{expected '(' after lifetime dependence specifier}}
23-
func testMissingLParenError(_ ne: NE) -> NE {
22+
@lifetime // expected-error{{expected '(' after lifetime dependence specifier}}
23+
func testMissingLParenError(_ ne: NE) -> NE { // expected-error{{cannot infer the lifetime dependence scope on a function with a ~Escapable parameter, specify '@lifetime(borrow ne)' or '@lifetime(copy ne)'}}
2424
ne
2525
}
2626

2727
@lifetime() // expected-error{{expected identifier, index or self in lifetime dependence specifier}}
28-
func testMissingDependence(_ ne: NE) -> NE {
28+
func testMissingDependence(_ ne: NE) -> NE { // expected-error{{cannot infer the lifetime dependence scope on a function with a ~Escapable parameter, specify '@lifetime(borrow ne)' or '@lifetime(copy ne)'}}
2929
ne
3030
}
3131

test/Runtime/demangleToMetadata.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -target %target-swift-5.1-abi-triple -parse-stdlib %s -module-name main -o %t/a.out
2+
// RUN: %target-build-swift -target %target-swift-5.1-abi-triple -parse-stdlib %s -module-name main -o %t/a.out \
3+
// RUN: -enable-experimental-feature LifetimeDependence
34
// RUN: %target-codesign %t/a.out
45
// RUN: %target-run %t/a.out
56
// REQUIRES: executable_test
67
// REQUIRES: concurrency
8+
// REQUIRES: swift_feature_LifetimeDependence
79
// UNSUPPORTED: use_os_stdlib
810
// UNSUPPORTED: back_deployment_runtime
911

test/SIL/Parser/basic2_noncopyable_generics.sil

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ struct NCG<T> : ~Copyable {
2929
// CHECK-NEXT: var t: T
3030
struct NEG<T : ~Escapable> : ~Escapable {
3131
var t: T
32+
@lifetime(copy t)
3233
init(_ t: consuming T) {
3334
self.t = t
3435
}

test/SIL/explicit_lifetime_dependence_specifiers.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal func _overrideLifetime<
2121
}
2222

2323
@_unsafeNonescapableResult
24-
@lifetime(source)
24+
@lifetime(copy source)
2525
internal func _overrideLifetime<
2626
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
2727
>(
@@ -56,12 +56,12 @@ struct BufferView : ~Escapable {
5656
self.ptr = ptr
5757
}
5858
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSW_AA7WrapperVtcfC : $@convention(method) (UnsafeRawBufferPointer, @owned Wrapper, @thin BufferView.Type) -> @lifetime(copy 1) @owned BufferView {
59-
@lifetime(a)
59+
@lifetime(copy a)
6060
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper) {
6161
self.ptr = ptr
6262
}
6363
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSW_AA7WrapperVSaySiGhtcfC : $@convention(method) (UnsafeRawBufferPointer, @owned Wrapper, @guaranteed Array<Int>, @thin BufferView.Type) -> @lifetime(copy 1, borrow 2) @owned BufferView {
64-
@lifetime(a, borrow b)
64+
@lifetime(copy a, borrow b)
6565
init(_ ptr: UnsafeRawBufferPointer, _ a: consuming Wrapper, _ b: borrowing Array<Int>) {
6666
self.ptr = ptr
6767
}
@@ -93,14 +93,14 @@ func derive(_ x: borrowing BufferView) -> BufferView {
9393
}
9494

9595
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16consumeAndCreateyAA10BufferViewVADnF : $@convention(thin) (@owned BufferView) -> @lifetime(copy 0) @owned BufferView {
96-
@lifetime(x)
96+
@lifetime(copy x)
9797
func consumeAndCreate(_ x: consuming BufferView) -> BufferView {
9898
let bv = BufferView(independent: x.ptr)
9999
return _overrideLifetime(bv, copying: x)
100100
}
101101

102102
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers17deriveThisOrThat1yAA10BufferViewVAD_ADtF : $@convention(thin) (@guaranteed BufferView, @guaranteed BufferView) -> @lifetime(copy 1, borrow 0) @owned BufferView {
103-
@lifetime(borrow this, that)
103+
@lifetime(borrow this, copy that)
104104
func deriveThisOrThat1(_ this: borrowing BufferView, _ that: borrowing BufferView) -> BufferView {
105105
if (Int.random(in: 1..<100) == 0) {
106106
return BufferView(independent: this.ptr)
@@ -109,7 +109,7 @@ func deriveThisOrThat1(_ this: borrowing BufferView, _ that: borrowing BufferVie
109109
}
110110

111111
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers17deriveThisOrThat2yAA10BufferViewVAD_ADntF : $@convention(thin) (@guaranteed BufferView, @owned BufferView) -> @lifetime(copy 1, borrow 0) @owned BufferView {
112-
@lifetime(borrow this, that)
112+
@lifetime(borrow this, copy that)
113113
func deriveThisOrThat2(_ this: borrowing BufferView, _ that: consuming BufferView) -> BufferView {
114114
if (Int.random(in: 1..<100) == 0) {
115115
return BufferView(independent: this.ptr)
@@ -122,6 +122,7 @@ func use(_ x: borrowing BufferView) {}
122122

123123
struct Wrapper : ~Escapable {
124124
let view: BufferView
125+
@lifetime(copy view)
125126
init(_ view: consuming BufferView) {
126127
self.view = view
127128
}
@@ -132,7 +133,7 @@ struct Wrapper : ~Escapable {
132133
}
133134

134135
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers7WrapperV8getView2AA10BufferViewVyF : $@convention(method) (@owned Wrapper) -> @lifetime(copy 0) @owned BufferView {
135-
@lifetime(self)
136+
@lifetime(copy self)
136137
consuming func getView2() -> BufferView {
137138
return view
138139
}
@@ -147,7 +148,7 @@ struct Container : ~Escapable {
147148
}
148149

149150
// CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers16getConsumingViewyAA06BufferG0VAA9ContainerVnF : $@convention(thin) (@owned Container) -> @lifetime(copy 0) @owned BufferView {
150-
@lifetime(x)
151+
@lifetime(copy x)
151152
func getConsumingView(_ x: consuming Container) -> BufferView {
152153
let bv = BufferView(independent: x.ptr)
153154
return _overrideLifetime(bv, copying: x)

0 commit comments

Comments
 (0)