Skip to content

Commit 8682b17

Browse files
committed
[move-only] Remove a set of TODO from when we were not properly marking non-consuming uses appropriately. We are doing so now.
1 parent 224674c commit 8682b17

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

test/SILOptimizer/moveonly_addresschecker_diagnostics.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,6 @@ public func classAssignToVar5() {
392392
var x2 = Klass() // expected-error {{'x2' used after consume}}
393393
x2 = Klass()
394394
var x3 = x2 // expected-note {{consuming use here}}
395-
// TODO: Need to mark this as the lifetime extending use. We fail
396-
// appropriately though.
397395
borrowVal(x2) // expected-note {{non-consuming use here}}
398396
x3 = Klass()
399397
consumeVal(x3)
@@ -1781,15 +1779,12 @@ public func enumPatternMatchIfLet2Arg(_ x2: inout EnumTy) { // expected-error {{
17811779
}
17821780
}
17831781

1784-
// This is wrong.
17851782
public func enumPatternMatchSwitch1() {
17861783
var x2 = EnumTy.klass(Klass()) // expected-error {{'x2' used after consume}}
17871784
x2 = EnumTy.klass(Klass())
17881785
switch x2 { // expected-note {{consuming use here}}
17891786
case let EnumTy.klass(k):
17901787
borrowVal(k)
1791-
// This should be flagged as the use after free use. We are atleast
1792-
// erroring though.
17931788
borrowVal(x2) // expected-note {{non-consuming use here}}
17941789
case .int:
17951790
break
@@ -1800,8 +1795,6 @@ public func enumPatternMatchSwitch1Arg(_ x2: inout EnumTy) { // expected-error {
18001795
switch x2 { // expected-note {{consuming use here}}
18011796
case let EnumTy.klass(k):
18021797
borrowVal(k)
1803-
// This should be flagged as the use after free use. We are atleast
1804-
// erroring though.
18051798
borrowVal(x2)
18061799
case .int:
18071800
break
@@ -2267,8 +2260,6 @@ public func addressOnlyGenericAssignToVar5<T : P>(_ ty: T.Type) {
22672260
var x2 = AddressOnlyGeneric<T>() // expected-error {{'x2' used after consume}}
22682261
x2 = AddressOnlyGeneric<T>()
22692262
var x3 = x2 // expected-note {{consuming use here}}
2270-
// TODO: Need to mark this as the lifetime extending use. We fail
2271-
// appropriately though.
22722263
borrowVal(x2) // expected-note {{non-consuming use here}}
22732264
x3 = AddressOnlyGeneric<T>()
22742265
consumeVal(x3)
@@ -2910,8 +2901,6 @@ public func addressOnlyProtocolAssignToVar5<T : P>(_ ty: T.Type) {
29102901
var x2 = AddressOnlyProtocol() // expected-error {{'x2' used after consume}}
29112902
x2 = AddressOnlyProtocol()
29122903
var x3 = x2 // expected-note {{consuming use here}}
2913-
// TODO: Need to mark this as the lifetime extending use. We fail
2914-
// appropriately though.
29152904
borrowVal(x2) // expected-note {{non-consuming use here}}
29162905
x3 = AddressOnlyProtocol()
29172906
consumeVal(x3)

0 commit comments

Comments
 (0)