Skip to content

Commit 6b1258c

Browse files
committed
Update a test I missed
1 parent f796f11 commit 6b1258c

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

test/Concurrency/transfernonsendable_ownership.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ struct CustomActor {
3535

3636
func testConsuming(_ x: consuming Klass) async {
3737
await transferToMain(x) // expected-warning {{transferring 'x' may cause a race}}
38-
// expected-note @-1 {{transferring nonisolated 'x' to main actor-isolated callee could cause races between main actor-isolated and nonisolated uses}}
38+
// expected-note @-1 {{transferring task-isolated 'x' to main actor-isolated callee could cause races between main actor-isolated and task-isolated uses}}
3939
}
4040

4141
func testConsumingError(_ x: consuming Klass) async {
4242
await transferToMain(x) // expected-warning {{transferring 'x' may cause a race}}
43-
// expected-note @-1 {{transferring nonisolated 'x' to main actor-isolated callee could cause races between main actor-isolated and nonisolated uses}}
43+
// expected-note @-1 {{transferring task-isolated 'x' to main actor-isolated callee could cause races between main actor-isolated and task-isolated uses}}
4444
print(x)
4545
}
4646

@@ -52,7 +52,7 @@ func testConsumingError(_ x: consuming Klass) async {
5252

5353
func testConsumingUseAfterConsumeError(_ x: consuming Klass) async { // expected-error {{'x' consumed more than once}}
5454
await consumeTransferToMain(x) // expected-warning {{transferring 'x' may cause a race}}
55-
// expected-note @-1 {{transferring nonisolated 'x' to main actor-isolated callee could cause races between main actor-isolated and nonisolated uses}}
55+
// expected-note @-1 {{transferring task-isolated 'x' to main actor-isolated callee could cause races between main actor-isolated and task-isolated uses}}
5656
// expected-note @-2 {{consumed here}}
5757
print(x)
5858
// expected-note @-1 {{consumed again here}}
@@ -66,31 +66,29 @@ func testConsumingUseAfterConsumeError(_ x: consuming Klass) async { // expected
6666
// expected-note @-1 {{consumed again here}}
6767
}
6868

69-
func testBorrowing(_ x: borrowing Klass) async { // expected-note {{value is task-isolated since it is in the same region as 'x'}}
69+
func testBorrowing(_ x: borrowing Klass) async {
7070
await transferToMain(x) // expected-warning {{task-isolated value of type 'Klass' transferred to main actor-isolated context}}
7171
}
7272

7373
func testBorrowingError(_ x: borrowing Klass) async { // expected-error {{'x' is borrowed and cannot be consumed}}
74-
// expected-note @-1 {{}}
7574
await transferToMain(x) // expected-warning {{task-isolated value of type 'Klass' transferred to main actor-isolated context}}
7675
print(x) // expected-note {{consumed here}}
7776
}
7877

7978
@CustomActor func testBorrowingErrorGlobalActor(_ x: borrowing Klass) async { // expected-error {{'x' is borrowed and cannot be consumed}}
80-
// expected-note @-1 {{}}
81-
await transferToMain(x) // expected-warning {{task-isolated value of type 'Klass' transferred to main actor-isolated context}}
79+
await transferToMain(x) // expected-warning {{global actor 'CustomActor'-isolated value of type 'Klass' transferred to main actor-isolated context}}
8280
print(x) // expected-note {{consumed here}}
8381
}
8482

8583
func testInOut(_ x: inout Klass) async {
8684
await transferToMain(x) // expected-warning {{transferring 'x' may cause a race}}
8785
// TODO: This is wrong. Should say task isolated!
88-
// expected-note @-2 {{transferring nonisolated 'x' to main actor-isolated callee could cause races between main actor-isolated and nonisolated uses}}
86+
// expected-note @-2 {{transferring task-isolated 'x' to main actor-isolated callee could cause races between main actor-isolated and task-isolated uses}}
8987
}
9088

9189
func testInOutError(_ x: inout Klass) async {
9290
await transferToMain(x) // expected-warning {{transferring 'x' may cause a race}}
93-
// expected-note @-1 {{transferring nonisolated 'x' to main actor-isolated callee}}
91+
// expected-note @-1 {{transferring task-isolated 'x' to main actor-isolated callee}}
9492
print(x)
9593
}
9694

@@ -104,4 +102,4 @@ func testInOutError(_ x: inout Klass) async {
104102
await transferToMain(x) // expected-warning {{transferring 'x' may cause a race}}
105103
// expected-note @-1 {{transferring global actor 'CustomActor'-isolated 'x' to main actor-isolated callee}}
106104
_ = consume x // expected-note {{consumed here}}
107-
} // expected-note {{used here}}
105+
} // expected-note {{used here}}

0 commit comments

Comments
 (0)