Skip to content

Commit 4f957fc

Browse files
committed
Update a test I missed
1 parent 7cda418 commit 4f957fc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

test/ClangImporter/transferring.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ func funcTestTransferringResult() async {
2828
let x2 = NonSendableCStruct()
2929
let y2 = returnUserDefinedFromGlobalFunction(x2)
3030
await transferToMain(x2) // expected-error {{transferring value of non-Sendable type 'NonSendableCStruct' from nonisolated context to main actor-isolated context}}
31-
useValue(y2) // expected-note {{access here could race}}
31+
useValue(y2) // expected-note {{use here could race}}
3232
}
3333

3434
func funcTestTransferringArg() async {
3535
let x = NonSendableCStruct()
36-
transferUserDefinedIntoGlobalFunction(x) // expected-error {{binding of non-Sendable type 'NonSendableCStruct' accessed after being transferred}}
37-
useValue(x) // expected-note {{access here could race}}
36+
transferUserDefinedIntoGlobalFunction(x) // expected-error {{value of non-Sendable type 'NonSendableCStruct' accessed after being transferred; later accesses could race}}
37+
useValue(x) // expected-note {{use here could race}}
3838
}

test/ClangImporter/transferring_objc.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ func methodTestTransferringResult() async {
2525
func methodTestTransferringArg() async {
2626
let x = MyType()
2727
let s = NSObject()
28-
let _ = x.getResultWithTransferringArgument(s) // expected-error {{binding of non-Sendable type 'NSObject' accessed after being transferred}}
29-
useValue(s) // expected-note {{access here could race}}
28+
let _ = x.getResultWithTransferringArgument(s) // expected-error {{transferring 's' may cause a race}}
29+
// expected-note @-1 {{'s' used after being passed as a transferring parameter; Later uses could race}}
30+
useValue(s) // expected-note {{use here could race}}
3031
}
3132

3233
// Make sure we just ignore the swift_attr if it is applied to something like a
@@ -46,11 +47,12 @@ func funcTestTransferringResult() async {
4647
let y2 = returnNSObjectFromGlobalFunction(x2)
4748
await transferToMain(x2) // expected-error {{transferring 'x2' may cause a race}}
4849
// expected-note @-1 {{transferring disconnected 'x2' to main actor-isolated callee could cause races in between callee main actor-isolated and local nonisolated uses}}
49-
useValue(y2) // expected-note {{access here could race}}
50+
useValue(y2) // expected-note {{use here could race}}
5051
}
5152

5253
func funcTestTransferringArg() async {
5354
let x = NSObject()
54-
transferNSObjectToGlobalFunction(x) // expected-error {{binding of non-Sendable type 'NSObject' accessed after being transferred}}
55-
useValue(x) // expected-note {{access here could race}}
55+
transferNSObjectToGlobalFunction(x) // expected-error {{transferring 'x' may cause a race}}
56+
// expected-note @-1 {{'x' used after being passed as a transferring parameter; Later uses could race}}
57+
useValue(x) // expected-note {{use here could race}}
5658
}

0 commit comments

Comments
 (0)