You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// FIXME: Region isolation should consider a value from a 'nonisolated(unsafe)'
32
32
// declaration to be in a disconnected region
33
33
34
-
// expected-region-isolation-warning @+3 {{transferring non-Sendable value 'it' could yield races with later accesses}}
34
+
// expected-region-isolation-warning @+3 {{transferring 'it' could cause a race}}
35
35
// expected-region-isolation-note @+2 {{'it' is transferred from main actor-isolated caller to nonisolated callee. Later uses in caller could race with potential uses in callee}}
36
36
// expected-region-isolation-note @+1 {{access here could race}}
lett=NonSendable() // expected-tns-note {{variable defined here}}
274
274
await t.update()
275
275
// expected-targeted-and-complete-warning @-1 {{passing argument of non-sendable type 'NonSendable' into main actor-isolated context may introduce data races}}
276
-
// expected-tns-warning @-2 {{transferring non-Sendable value 't' could yield races with later accesses}}
276
+
// expected-tns-warning @-2 {{transferring 't' could cause a race}}
277
277
// expected-tns-note @-3 {{'t' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
varx=StructContainingValue() // expected-tns-note {{variable defined here}}
105
105
x =StructContainingValue()
106
106
107
-
awaittransferToNonIsolated(x) // expected-tns-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
107
+
awaittransferToNonIsolated(x) // expected-tns-warning {{transferring 'x' could cause a race}}
108
108
// expected-tns-note @-1 {{'x' is transferred from global actor 'GlobalActor'-isolated caller to nonisolated callee. Later uses in caller could race with potential uses in callee}}
109
109
// expected-complete-warning @-2 {{passing argument of non-sendable type 'StructContainingValue' outside of global actor 'GlobalActor'-isolated context may introduce data races}}
Copy file name to clipboardExpand all lines: test/Concurrency/transfernonsendable_region_based_sendability.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -353,7 +353,7 @@ func test_indirect_regions(a : A, b : Bool) async {
353
353
}
354
354
355
355
if(b){
356
-
await a.foo(ns5_0) // expected-tns-warning {{transferring non-Sendable value 'ns5_0' could yield races with later accesses}}
356
+
await a.foo(ns5_0) // expected-tns-warning {{transferring 'ns5_0' could cause a race}}
357
357
// expected-tns-note @-1 {{'ns5_0' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
358
358
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any' into actor-isolated context may introduce data races}}
359
359
@@ -363,7 +363,7 @@ func test_indirect_regions(a : A, b : Bool) async {
363
363
print(ns5_1) // expected-tns-note {{access here could race}}
364
364
}
365
365
}else{
366
-
await a.foo(ns5_1) // expected-tns-warning {{transferring non-Sendable value 'ns5_1' could yield races with later accesses}}
366
+
await a.foo(ns5_1) // expected-tns-warning {{transferring 'ns5_1' could cause a race}}
367
367
// expected-tns-note @-1 {{'ns5_1' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
368
368
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any' into actor-isolated context may introduce data races}}
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
96
+
awaittransferToMain(x) // expected-warning {{transferring 'x' could cause a race}}
97
97
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
98
98
awaittransferToMain(x) // expected-note {{access here could race}}
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
103
+
awaittransferToMain(x) // expected-warning {{transferring 'x' could cause a race}}
104
104
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
105
105
useValue(x) // expected-note {{access here could race}}
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
119
+
awaittransferToMain(x) // expected-warning {{transferring 'x' could cause a race}}
120
120
// expected-note @-1 {{'x' is transferred from actor-isolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
121
121
awaittransferToMain(x) // expected-note {{access here could race}}
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
126
+
awaittransferToMain(x) // expected-warning {{transferring 'x' could cause a race}}
127
127
// expected-note @-1 {{'x' is transferred from actor-isolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
128
128
useValue(x) // expected-note {{access here could race}}
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
166
+
awaittransferToMain(x) // expected-warning {{transferring 'x' could cause a race}}
167
167
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
168
168
let _ = x // expected-note {{access here could race}}
// TODO: This should refer to the transferring parameter.
229
-
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
229
+
awaittransferToMain(x) // expected-warning {{transferring 'x' could cause a race}}
230
230
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
231
231
232
232
useValue(x) // expected-note {{access here could race}}
@@ -256,7 +256,7 @@ func mergeDoesNotEliminateEarlierTransfer(_ x: transferring NonSendableStruct) a
256
256
useValue(x)
257
257
258
258
// Transfer x
259
-
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
259
+
awaittransferToMain(x) // expected-warning {{transferring 'x' could cause a race}}
260
260
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
261
261
262
262
// y is assigned into a field of x, so we treat this like a merge.
awaittransferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
277
+
awaittransferToMain(x) // expected-warning {{transferring 'x' could cause a race}}
278
278
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
279
279
280
280
// y is assigned into a field of x, so we treat this like a merge.
Copy file name to clipboardExpand all lines: test/Concurrency/transfernonsendable_strong_transferring_results.swift
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ func simpleTest() async {
68
68
func simpleTest2()async{
69
69
letx=NonSendableKlass() // expected-note {{variable defined here}}
70
70
lety=transferResultWithArg(x)
71
-
awaittransferToMainDirect(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
71
+
awaittransferToMainDirect(x) // expected-warning {{transferring 'x' could cause a race}}
72
72
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
73
73
useValue(y)
74
74
useValue(x) // expected-note {{access here could race}}
@@ -79,14 +79,14 @@ func simpleTest3() async {
79
79
letx=NonSendableKlass()
80
80
lety=transferResultWithArg(x) // expected-note {{variable defined here}}
81
81
awaittransferToMainDirect(x)
82
-
awaittransferToMainDirect(y) // expected-warning {{transferring non-Sendable value 'y' could yield races with later accesses}}
82
+
awaittransferToMainDirect(y) // expected-warning {{transferring 'y' could cause a race}}
83
83
// expected-note @-1 {{'y' is transferred from nonisolated caller to main actor-isolated callee}}
84
84
useValue(y) // expected-note {{access here could race}}
letx=NonSendableKlass() // expected-note {{variable defined here}}
89
-
awaittransferToMainDirect(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
89
+
awaittransferToMainDirect(x) // expected-warning {{transferring 'x' could cause a race}}
90
90
// expected-note @-1 {{'x' is transferred from nonisolated caller to main actor-isolated callee. Later uses in caller could race with potential uses in callee}}
91
91
return x // expected-note {{access here could race}}
0 commit comments