Skip to content

Commit f87dbb5

Browse files
committed
[region-isolation] Eliminate term "binding" from diagnostic.
1 parent 7df13b3 commit f87dbb5

6 files changed

+11
-11
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,13 +940,13 @@ NOTE(regionbasedisolation_isolated_since_in_same_region_basename, none,
940940
//
941941

942942
ERROR(regionbasedisolation_named_transfer_yields_race, none,
943-
"transferring non-Sendable binding %0 could yield races with later accesses",
943+
"transferring non-Sendable value %0 could yield races with later accesses",
944944
(Identifier))
945945
NOTE(regionbasedisolation_named_info_transfer_yields_race, none,
946946
"%0 is transferred from %1 caller to %2 callee. Later uses in caller could race with potential uses in callee",
947947
(Identifier, ActorIsolation, ActorIsolation))
948948
NOTE(regionbasedisolation_named_info_isolated_capture, none,
949-
"%1 binding %0 is captured by %2 closure. Later local uses could race",
949+
"%1 value %0 is captured by %2 closure. Later local uses could race",
950950
(Identifier, ActorIsolation, ActorIsolation))
951951
NOTE(regionbasedisolation_named_arg_info, none,
952952
"Transferring task isolated function argument %0 could yield races with caller uses",

test/Concurrency/experimental_feature_strictconcurrency.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func iterate(stream: AsyncStream<Int>) async {
3131
// FIXME: Region isolation should consider a value from a 'nonisolated(unsafe)'
3232
// declaration to be in a disconnected region
3333

34-
// expected-region-isolation-warning @+3 {{transferring non-Sendable binding 'it' could yield races with later accesses}}
34+
// expected-region-isolation-warning @+3 {{transferring non-Sendable value 'it' could yield races with later accesses}}
3535
// 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}}
3636
// expected-region-isolation-note @+1 {{access here could race}}
3737
while let element = await it.next() {

test/Concurrency/sendable_checking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func testNonSendableBaseArg() async {
273273
let t = NonSendable() // expected-tns-note {{variable defined here}}
274274
await t.update()
275275
// 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 binding 't' could yield races with later accesses}}
276+
// expected-tns-warning @-2 {{transferring non-Sendable value 't' could yield races with later accesses}}
277277
// 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}}
278278

279279
_ = await t.x

test/Concurrency/transfernonsendable.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func closureInOut(_ a: Actor) async {
123123

124124
await a.useKlass(ns0)
125125
// expected-complete-warning @-1 {{passing argument of non-sendable type 'NonSendableKlass'}}
126-
// expected-tns-warning @-2 {{transferring non-Sendable binding 'ns0' could yield races with later accesses}}
126+
// expected-tns-warning @-2 {{transferring non-Sendable value 'ns0' could yield races with later accesses}}
127127
// expected-tns-note @-3 {{'ns0' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
128128

129129
// We only emit a warning on the first use we see, so make sure we do both
@@ -146,13 +146,13 @@ func closureInOut2(_ a: Actor) async {
146146

147147
var closure = {}
148148

149-
await a.useKlass(ns0) // expected-tns-warning {{transferring non-Sendable binding 'ns0' could yield races with later accesses}}
149+
await a.useKlass(ns0) // expected-tns-warning {{transferring non-Sendable value 'ns0' could yield races with later accesses}}
150150
// expected-tns-note @-1 {{'ns0' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
151151
// expected-complete-warning @-2 {{passing argument of non-sendable type 'NonSendableKlass'}}
152152

153153
closure = { useInOut(&contents) } // expected-tns-note {{access here could race}}
154154

155-
await a.useKlass(ns1) // expected-tns-warning {{transferring non-Sendable binding 'ns1' could yield races with later accesses}}
155+
await a.useKlass(ns1) // expected-tns-warning {{transferring non-Sendable value 'ns1' could yield races with later accesses}}
156156
// expected-tns-note @-1 {{'ns1' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
157157
// expected-complete-warning @-2 {{passing argument of non-sendable type 'NonSendableKlass'}}
158158

@@ -174,7 +174,7 @@ func closureNonInOut(_ a: Actor) async {
174174

175175
closure = { useValue(contents) }
176176

177-
await a.useKlass(ns1) // expected-tns-warning {{transferring non-Sendable binding 'ns1' could yield races with later accesses}}
177+
await a.useKlass(ns1) // expected-tns-warning {{transferring non-Sendable value 'ns1' could yield races with later accesses}}
178178
// expected-tns-note @-1 {{'ns1' is transferred from nonisolated caller to actor-isolated callee. Later uses in caller could race with potential uses in callee}}
179179
// expected-complete-warning @-2 {{passing argument of non-sendable type 'NonSendableKlass'}}
180180

test/Concurrency/transfernonsendable_region_based_sendability.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ func test_indirect_regions(a : A, b : Bool) async {
353353
}
354354

355355
if (b) {
356-
await a.foo(ns5_0) // expected-tns-warning {{transferring non-Sendable binding 'ns5_0' could yield races with later accesses}}
356+
await a.foo(ns5_0) // expected-tns-warning {{transferring non-Sendable value 'ns5_0' could yield races with later accesses}}
357357
// 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}}
358358
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any' into actor-isolated context may introduce data races}}
359359

@@ -363,7 +363,7 @@ func test_indirect_regions(a : A, b : Bool) async {
363363
print(ns5_1) // expected-tns-note {{access here could race}}
364364
}
365365
} else {
366-
await a.foo(ns5_1) // expected-tns-warning {{transferring non-Sendable binding 'ns5_1' could yield races with later accesses}}
366+
await a.foo(ns5_1) // expected-tns-warning {{transferring non-Sendable value 'ns5_1' could yield races with later accesses}}
367367
// 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}}
368368
// expected-complete-warning @-2 {{passing argument of non-sendable type 'Any' into actor-isolated context may introduce data races}}
369369

test/Concurrency/transfernonsendable_strong_transferring.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func canTransferAfterAssignButUseIsError(_ x: transferring Any) async {
214214
x = y
215215

216216
// TODO: This should refer to the transferring parameter.
217-
await transferToMain(x) // expected-warning {{transferring non-Sendable binding 'x' could yield races with later accesses}}
217+
await transferToMain(x) // expected-warning {{transferring non-Sendable value 'x' could yield races with later accesses}}
218218
// 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}}
219219

220220
useValue(x) // expected-note {{access here could race}}

0 commit comments

Comments
 (0)