Skip to content

Commit ef8f0e9

Browse files
committed
Remove callee from diagnostics.
1 parent d034dd6 commit ef8f0e9

9 files changed

+25
-25
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ ERROR(regionbasedisolation_type_transfer_yields_race, none,
955955
(Type))
956956

957957
NOTE(regionbasedisolation_type_use_after_transfer, none,
958-
"sending value of non-Sendable type %0 to %1 callee risks causing data races between %1 and local %2 uses",
958+
"sending value of non-Sendable type %0 to %1 function risks causing data races between %1 and local %2 uses",
959959
(Type, ActorIsolation, ActorIsolation))
960960
NOTE(regionbasedisolation_type_use_after_transfer_callee, none,
961961
"sending value of non-Sendable type %0 to %1 %2 %3 risks causing data races between %1 and local %4 uses",
@@ -986,14 +986,14 @@ NOTE(regionbasedisolation_out_sending_cannot_be_actor_isolated_note_named, none,
986986
(Identifier, StringRef))
987987

988988
NOTE(regionbasedisolation_named_info_transfer_yields_race, none,
989-
"sending %1%0 to %2 callee risks causing data races between %2 and local %3 uses",
989+
"sending %1%0 to %2 function risks causing data races between %2 and local %3 uses",
990990
(Identifier, StringRef, ActorIsolation, ActorIsolation))
991991
NOTE(regionbasedisolation_named_info_transfer_yields_race_callee, none,
992992
"sending %1%0 to %2 %3 %4 risks causing data races between %2 and local %5 uses",
993993
(Identifier, StringRef, ActorIsolation, DescriptiveDeclKind, DeclName, ActorIsolation))
994994

995995
NOTE(regionbasedisolation_named_transfer_non_transferrable, none,
996-
"sending %1%0 to %2 callee risks causing data races between %2 and %3 uses",
996+
"sending %1%0 to %2 function risks causing data races between %2 and %3 uses",
997997
(Identifier, StringRef, ActorIsolation, StringRef))
998998
NOTE(regionbasedisolation_named_transfer_non_transferrable_callee, none,
999999
"sending %1%0 to %2 %3 %4 risks causing data races between %2 and %5 uses",
@@ -1003,7 +1003,7 @@ NOTE(regionbasedisolation_named_nonisolated_asynclet_name, none,
10031003
(Identifier))
10041004

10051005
NOTE(regionbasedisolation_named_transfer_into_sending_param, none,
1006-
"%0%1 is passed as a 'sending' parameter; Uses in callee may race with later %0uses",
1006+
"%0%1 is passed as a 'sending' parameter; Uses in function may race with later %0uses",
10071007
(StringRef, Identifier))
10081008
NOTE(regionbasedisolation_named_notransfer_transfer_into_result, none,
10091009
"%0%1 cannot be a 'sending' result. %2 uses may race with caller uses",
@@ -1015,7 +1015,7 @@ NOTE(regionbasedisolation_named_isolated_closure_yields_race, none,
10151015
"%0%1 is captured by a %2 closure. %2 uses in closure may race against later %3 uses",
10161016
(StringRef, Identifier, ActorIsolation, ActorIsolation))
10171017
NOTE(regionbasedisolation_typed_tns_passed_to_sending, none,
1018-
"Passing %0 value of non-Sendable type %1 as a 'sending' parameter risks causing races inbetween %0 uses and uses reachable from the callee",
1018+
"Passing %0 value of non-Sendable type %1 as a 'sending' parameter risks causing races inbetween %0 uses and uses reachable from the function",
10191019
(StringRef, Type))
10201020
NOTE(regionbasedisolation_typed_tns_passed_to_sending_callee, none,
10211021
"Passing %0 value of non-Sendable type %1 as a 'sending' parameter to %2 %3 risks causing races inbetween %0 uses and uses reachable from %3",
@@ -1033,7 +1033,7 @@ NOTE(regionbasedisolation_typed_use_after_sending_callee, none,
10331033
(Type, DescriptiveDeclKind, DeclName))
10341034

10351035
NOTE(regionbasedisolation_typed_transferneversendable_via_arg, none,
1036-
"sending %0 value of non-Sendable type %1 to %2 callee risks causing races in between %0 and %2 uses",
1036+
"sending %0 value of non-Sendable type %1 to %2 function risks causing races in between %0 and %2 uses",
10371037
(StringRef, Type, ActorIsolation))
10381038
NOTE(regionbasedisolation_typed_transferneversendable_via_arg_callee, none,
10391039
"sending %0 value of non-Sendable type %1 to %2 %3 %4 risks causing races in between %0 and %2 uses",

test/Concurrency/concurrent_value_checking.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,22 +414,22 @@ extension NotConcurrent {
414414

415415
func test() {
416416
Task { // expected-tns-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
417-
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the callee}}
417+
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the function}}
418418
f()
419419
}
420420

421421
Task { // expected-tns-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
422-
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the callee}}
422+
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the function}}
423423
self.f()
424424
}
425425

426426
Task { [self] in // expected-tns-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
427-
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the callee}}
427+
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the function}}
428428
f()
429429
}
430430

431431
Task { [self] in // expected-tns-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
432-
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the callee}}
432+
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the function}}
433433
self.f()
434434
}
435435
}

test/Concurrency/isolated_parameters.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ func testNonSendableCaptures(ns: NotSendable, a: isolated MyActor) {
502502
// FIXME: The `a` in the capture list and `isolated a` are the same,
503503
// but the actor isolation checker doesn't know that.
504504
Task { [a] in // expected-tns-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
505-
// expected-tns-note @-1 {{Passing 'a'-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween 'a'-isolated uses and uses reachable from the callee}}
505+
// expected-tns-note @-1 {{Passing 'a'-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween 'a'-isolated uses and uses reachable from the function}}
506506
_ = a
507507
_ = ns
508508
}

test/Concurrency/sendable_checking.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,12 @@ func callNonisolatedAsyncClosure(
337337
) async {
338338
await g(ns)
339339
// expected-tns-warning @-1 {{sending 'ns' risks causing data races}}
340-
// expected-tns-note @-2 {{sending main actor-isolated 'ns' to nonisolated callee risks causing data races between nonisolated and main actor-isolated uses}}
340+
// expected-tns-note @-2 {{sending main actor-isolated 'ns' to nonisolated function risks causing data races between nonisolated and main actor-isolated uses}}
341341

342342
let f: (NonSendable) async -> () = globalSendable // okay
343343
await f(ns)
344344
// expected-tns-warning @-1 {{sending 'ns' risks causing data races}}
345-
// expected-tns-note @-2 {{sending main actor-isolated 'ns' to nonisolated callee risks causing data races between nonisolated and main actor-isolated uses}}
345+
// expected-tns-note @-2 {{sending main actor-isolated 'ns' to nonisolated function risks causing data races between nonisolated and main actor-isolated uses}}
346346
}
347347

348348
@available(SwiftStdlib 5.1, *)

test/Concurrency/sendable_preconcurrency.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct MyType3 {
3333
func testA(ns: NS, mt: MyType, mt2: MyType2, mt3: MyType3, sc: StrictClass, nsc: NonStrictClass) async {
3434
// This is task isolated since we are capturing function arguments.
3535
Task { // expected-tns-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
36-
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the callee}}
36+
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the function}}
3737
print(ns)
3838
print(mt) // no warning: MyType is Sendable because we suppressed NonStrictClass's warning
3939
print(mt2)

test/Concurrency/sendable_without_preconcurrency.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct MyType2 {
2727

2828
func testA(ns: NS, mt: MyType, mt2: MyType2, sc: StrictClass, nsc: NonStrictClass) async {
2929
Task { // expected-tns-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races; this is an error in the Swift 6 language mode}}
30-
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the callee}}
30+
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the function}}
3131
print(ns)
3232
print(mt) // no warning by default: MyType is Sendable because we suppressed NonStrictClass's warning
3333
print(mt2)

test/Concurrency/sendable_without_preconcurrency_2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct MyType2: Sendable {
3030

3131
func testA(ns: NS, mt: MyType, mt2: MyType2, sc: StrictClass, nsc: NonStrictClass) async {
3232
Task { // expected-tns-warning {{sending value of non-Sendable type '() async -> ()' risks causing data races}}
33-
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the callee}}
33+
// expected-tns-note @-1 {{Passing task-isolated value of non-Sendable type '() async -> ()' as a 'sending' parameter risks causing races inbetween task-isolated uses and uses reachable from the function}}
3434
print(ns)
3535
print(mt) // no warning with targeted: MyType is Sendable because we suppressed NonStrictClass's warning
3636
print(mt2)

test/Concurrency/transfernonsendable_preconcurrency_sending.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,35 +118,35 @@ func testNeverTransfer(_ x: PreCUncheckedNonSendableKlass) async {
118118
func testNeverTransferExplicit(_ x: PreCUncheckedExplicitlyNonSendableKlass) async {
119119
transferArg(x) // expected-swift-5-no-tns-warning {{passing argument of non-sendable type 'PreCUncheckedExplicitlyNonSendableKlass' (aka 'ExplicitlyNonSendableKlass') into main actor-isolated context may introduce data races}}
120120
// expected-swift-5-warning @-1 {{sending 'x' risks causing data races}}
121-
// expected-swift-5-note @-2 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
121+
// expected-swift-5-note @-2 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
122122
// expected-swift-6-warning @-3 {{sending 'x' risks causing data races}}
123-
// expected-swift-6-note @-4 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
123+
// expected-swift-6-note @-4 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
124124
}
125125

126126
func testNeverTransferNormal(_ x: PostCUncheckedNonSendableKlass) async {
127127
transferArg(x) // expected-swift-5-no-tns-warning {{passing argument of non-sendable type 'PostCUncheckedNonSendableKlass' (aka 'NonSendableKlass') into main actor-isolated context may introduce data races}}
128128
// expected-swift-5-warning @-1 {{sending 'x' risks causing data races}}
129-
// expected-swift-5-note @-2 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
129+
// expected-swift-5-note @-2 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
130130
// expected-swift-6-error @-3 {{sending 'x' risks causing data races}}
131-
// expected-swift-6-note @-4 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
131+
// expected-swift-6-note @-4 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
132132
}
133133

134134
// Inexact match => normal behavior.
135135
func testNeverTransferInexactMatch(_ x: (PreCUncheckedNonSendableKlass, PreCUncheckedNonSendableKlass)) async {
136136
transferArg(x) // expected-swift-5-no-tns-warning 2{{passing argument of non-sendable type '(PreCUncheckedNonSendableKlass, PreCUncheckedNonSendableKlass)' (aka '(NonSendableKlass, NonSendableKlass)') into main actor-isolated context may introduce data races}}
137137
// expected-swift-5-warning @-1 {{sending 'x' risks causing data races}}
138-
// expected-swift-5-note @-2 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
138+
// expected-swift-5-note @-2 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
139139
// expected-swift-6-error @-3 {{sending 'x' risks causing data races}}
140-
// expected-swift-6-note @-4 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
140+
// expected-swift-6-note @-4 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
141141
}
142142

143143
// Inexact match => normal behavior.
144144
func testNeverTransferInexactMatchExplicit(_ x: (PreCUncheckedExplicitlyNonSendableKlass, PreCUncheckedExplicitlyNonSendableKlass)) async {
145145
transferArg(x) // expected-swift-5-no-tns-warning {{passing argument of non-sendable type '(PreCUncheckedExplicitlyNonSendableKlass, PreCUncheckedExplicitlyNonSendableKlass)' (aka '(ExplicitlyNonSendableKlass, ExplicitlyNonSendableKlass)') into main actor-isolated context may introduce data races}}
146146
// expected-swift-5-warning @-1 {{sending 'x' risks causing data races}}
147-
// expected-swift-5-note @-2 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
147+
// expected-swift-5-note @-2 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
148148
// expected-swift-6-error @-3 {{sending 'x' risks causing data races}}
149-
// expected-swift-6-note @-4 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
149+
// expected-swift-6-note @-4 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
150150
}
151151

152152

test/Concurrency/transfernonsendable_warning_until_swift6.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func testTransferArgumentError(_ x: NonSendableType) async {
3232

3333
func testPassArgumentAsTransferringParameter(_ x: NonSendableType) async {
3434
transferValue(x) // expected-error {{sending 'x' risks causing data races}}
35-
// expected-note @-1 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses}}
35+
// expected-note @-1 {{task-isolated 'x' is passed as a 'sending' parameter; Uses in function may race with later task-isolated uses}}
3636
}
3737

3838
func testAssignmentIntoTransferringParameter(_ x: sending NonSendableType) async {

0 commit comments

Comments
 (0)