Skip to content

Commit 3d4d3ca

Browse files
committed
[region-isolation] Some more diagnostic wordsmithing.
rdar://127580781 (cherry picked from commit f64f252)
1 parent 6b910c2 commit 3d4d3ca

20 files changed

+343
-343
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ NOTE(sil_referencebinding_inout_binding_here, none,
941941
//===----------------------------------------------------------------------===//
942942

943943
NOTE(regionbasedisolation_maybe_race, none,
944-
"potential concurrent access", ())
944+
"access can happen concurrently", ())
945945
ERROR(regionbasedisolation_unknown_pattern, none,
946946
"pattern that the region based isolation checker does not understand how to check. Please file a bug",
947947
())

test/ClangImporter/transferring.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ func funcTestTransferringResult() async {
2929
let y2 = returnUserDefinedFromGlobalFunction(x2)
3030
await transferToMain(x2) // expected-error {{sending 'x2' risks causing data races}}
3131
// expected-note @-1 {{sending 'x2' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
32-
useValue(y2) // expected-note {{potential concurrent access}}
32+
useValue(y2) // expected-note {{access can happen concurrently}}
3333
}
3434

3535
func funcTestTransferringArg() async {
3636
let x = NonSendableCStruct()
3737
transferUserDefinedIntoGlobalFunction(x) // expected-error {{sending 'x' risks causing data races}}
3838
// expected-note @-1 {{'x' used after being passed as a transferring parameter}}
39-
useValue(x) // expected-note {{potential concurrent access}}
39+
useValue(x) // expected-note {{access can happen concurrently}}
4040
}

test/ClangImporter/transferring_objc.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func methodTestTransferringArg() async {
2727
let s = NSObject()
2828
let _ = x.getResultWithTransferringArgument(s) // expected-error {{sending 's' risks causing data races}}
2929
// expected-note @-1 {{'s' used after being passed as a transferring parameter; Later uses could race}}
30-
useValue(s) // expected-note {{potential concurrent access}}
30+
useValue(s) // expected-note {{access can happen concurrently}}
3131
}
3232

3333
// Make sure we just ignore the swift_attr if it is applied to something like a
@@ -47,12 +47,12 @@ func funcTestTransferringResult() async {
4747
let y2 = returnNSObjectFromGlobalFunction(x2)
4848
await transferToMain(x2) // expected-error {{sending 'x2' risks causing data races}}
4949
// expected-note @-1 {{sending 'x2' to main actor-isolated global function 'transferToMain' risks causing data races between main actor-isolated and local nonisolated uses}}
50-
useValue(y2) // expected-note {{potential concurrent access}}
50+
useValue(y2) // expected-note {{access can happen concurrently}}
5151
}
5252

5353
func funcTestTransferringArg() async {
5454
let x = NSObject()
5555
transferNSObjectToGlobalFunction(x) // expected-error {{sending 'x' risks causing data races}}
5656
// expected-note @-1 {{'x' used after being passed as a transferring parameter; Later uses could race}}
57-
useValue(x) // expected-note {{potential concurrent access}}
57+
useValue(x) // expected-note {{access can happen concurrently}}
5858
}

test/Concurrency/sendable_checking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func testNonSendableBaseArg() async {
282282

283283
_ = await t.x
284284
// expected-warning @-1 {{non-sendable type 'NonSendable' passed in implicitly asynchronous call to main actor-isolated property 'x' cannot cross actor boundary}}
285-
// expected-tns-note@-2 {{potential concurrent access}}
285+
// expected-tns-note@-2 {{access can happen concurrently}}
286286
}
287287

288288
@available(SwiftStdlib 5.1, *)

test/Concurrency/transfernonsendable.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ bb0:
160160
// expected-warning @-1 {{}}
161161
%useIndirect = function_ref @useIndirect : $@convention(thin) <τ_0_0> (@in_guaranteed τ_0_0) -> ()
162162
apply %useIndirect<NonSendableKlass>(%1) : $@convention(thin) <τ_0_0> (@in_guaranteed τ_0_0) -> ()
163-
// expected-note @-1 {{potential concurrent access}}
163+
// expected-note @-1 {{access can happen concurrently}}
164164

165165
destroy_addr %1 : $*NonSendableKlass
166166
dealloc_stack %1 : $*NonSendableKlass

test/Concurrency/transfernonsendable.swift

Lines changed: 66 additions & 66 deletions
Large diffs are not rendered by default.

test/Concurrency/transfernonsendable_asynclet.swift

Lines changed: 60 additions & 60 deletions
Large diffs are not rendered by default.

test/Concurrency/transfernonsendable_cfg.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bb3:
4747
// expected-warning @-1 {{}}
4848
%useKlass = function_ref @useKlass : $@convention(thin) (@guaranteed NonSendableKlass) -> ()
4949
apply %useKlass(%klass) : $@convention(thin) (@guaranteed NonSendableKlass) -> ()
50-
// expected-note @-1 {{potential concurrent access}}
50+
// expected-note @-1 {{access can happen concurrently}}
5151
destroy_value %klass : $NonSendableKlass
5252
%9999 = tuple ()
5353
return %9999 : $()

test/Concurrency/transfernonsendable_initializers.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func initActorWithSyncNonIsolatedInit() {
5858
// TODO: This should say actor isolated.
5959
_ = ActorWithSynchronousNonIsolatedInit(k) // expected-error {{sending 'k' risks causing data races}}
6060
// expected-note @-1 {{sending 'k' to actor-isolated initializer 'init(_:)' risks causing data races between actor-isolated and local nonisolated uses}}
61-
let _ = { @MainActor in // expected-note {{potential concurrent access}}
61+
let _ = { @MainActor in // expected-note {{access can happen concurrently}}
6262
print(k)
6363
}
6464
}
@@ -87,7 +87,7 @@ func initActorWithAsyncIsolatedInit() async {
8787
// TODO: This should say actor isolated.
8888
_ = await ActorWithAsyncIsolatedInit(k) // expected-error {{sending 'k' risks causing data races}}
8989
// expected-note @-1 {{sending 'k' to actor-isolated initializer 'init(_:)' risks causing data races between actor-isolated and local nonisolated uses}}
90-
let _ = { @MainActor in // expected-note {{potential concurrent access}}
90+
let _ = { @MainActor in // expected-note {{access can happen concurrently}}
9191
print(k)
9292
}
9393
}
@@ -155,7 +155,7 @@ func initClassWithAsyncIsolatedInit() async {
155155
// MainActor.
156156
_ = await ClassWithAsyncIsolatedInit(k) // expected-error {{sending 'k' risks causing data races}}
157157
// expected-note @-1 {{sending 'k' to global actor 'CustomActor'-isolated initializer 'init(_:)' risks causing data races between global actor 'CustomActor'-isolated and local nonisolated uses}}
158-
let _ = { @MainActor in // expected-note {{potential concurrent access}}
158+
let _ = { @MainActor in // expected-note {{access can happen concurrently}}
159159
print(k)
160160
}
161161
}

0 commit comments

Comments
 (0)