Skip to content

Commit d816f0f

Browse files
authored
Merge pull request #81691 from gottesmm/pr-9f39c3c00daaa015dbbad351349202f5f9238db6
[sema] Change non-sendable -> non-Sendable in diagnostics.
2 parents a313a63 + 3ed4059 commit d816f0f

File tree

56 files changed

+575
-575
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+575
-575
lines changed

include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ GROUPED_WARNING(clang_swift_attr_unhandled, ClangDeclarationImport, none,
9292
"ignoring unknown Swift attribute or modifier '%0'", (StringRef))
9393

9494
GROUPED_WARNING(clang_error_code_must_be_sendable, ClangDeclarationImport, none,
95-
"cannot make error code type '%0' non-sendable because Swift errors "
95+
"cannot make error code type '%0' non-Sendable because Swift errors "
9696
"are always sendable", (StringRef))
9797

9898
GROUPED_WARNING(clang_ignored_sendable_attr, ClangDeclarationImport, none,

include/swift/AST/DiagnosticsSema.def

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5033,28 +5033,28 @@ NOTE(silence_debug_description_in_interpolation_segment_call,none,
50335033
"use 'String(describing:)' to silence this warning", ())
50345034

50355035
NOTE(noescape_parameter,none,
5036-
"parameter %1 is implicitly %select{non-escaping|non-sendable}0",
5036+
"parameter %1 is implicitly %select{non-escaping|non-Sendable}0",
50375037
(unsigned, Identifier))
50385038
NOTE(generic_parameters_always_escaping,none,
50395039
"generic parameters are always considered '@escaping'", ())
50405040

50415041
ERROR(passing_noattrfunc_to_attrfunc,none,
5042-
"passing %select{non-escaping|non-sendable}0 parameter %1 to function "
5042+
"passing %select{non-escaping|non-Sendable}0 parameter %1 to function "
50435043
"expecting %select{an '@escaping'|a '@Sendable'}0 closure",
50445044
(unsigned, Identifier))
50455045
ERROR(converting_noescape_param_to_generic_type,none,
50465046
"converting non-escaping parameter %0 to generic parameter %1 may allow it to escape",
50475047
(Identifier, Type))
50485048
ERROR(assigning_noattrfunc_to_attrfunc,none,
5049-
"assigning %select{non-escaping|non-sendable}0 parameter %1 to "
5049+
"assigning %select{non-escaping|non-Sendable}0 parameter %1 to "
50505050
"%select{an '@escaping'|a '@Sendable'}0 closure",
50515051
(unsigned, Identifier))
50525052
ERROR(general_noattrfunc_to_attr,none,
5053-
"using %select{non-escaping|non-sendable}0 parameter %1 in a context "
5053+
"using %select{non-escaping|non-Sendable}0 parameter %1 in a context "
50545054
"expecting %select{an '@escaping'|a '@Sendable'}0 closure",
50555055
(unsigned, Identifier))
50565056
ERROR(converting_noattrfunc_to_type,none,
5057-
"converting %select{non-escaping|non-sendable function}0 value to %1 "
5057+
"converting %select{non-escaping|non-Sendable function}0 value to %1 "
50585058
"may %select{allow it to escape|introduce data races}0",
50595059
(unsigned, Type))
50605060
NOTE(escape_expected_at_parameter_position,none,
@@ -5697,15 +5697,15 @@ GROUPED_ERROR(concurrent_access_of_inout_param,SendableClosureCaptures,none,
56975697
"concurrently-executing code",
56985698
(DeclName))
56995699
GROUPED_ERROR(non_sendable_capture,SendableClosureCaptures,none,
5700-
"capture of %1 with non-sendable type %0 in a '@Sendable' "
5700+
"capture of %1 with non-Sendable type %0 in a '@Sendable' "
57015701
"%select{local function|closure}2",
57025702
(Type, DeclName, bool))
57035703
ERROR(non_sendable_isolated_capture,none,
5704-
"capture of %1 with non-sendable type %0 in an isolated "
5704+
"capture of %1 with non-Sendable type %0 in an isolated "
57055705
"%select{local function|closure}2",
57065706
(Type, DeclName, bool))
57075707
ERROR(non_sendable_metatype_capture,none,
5708-
"capture of non-sendable type %0 in an isolated "
5708+
"capture of non-Sendable type %0 in an isolated "
57095709
"%select{local function|closure}1",
57105710
(Type, bool))
57115711
ERROR(self_capture_deinit_task,none,
@@ -5842,77 +5842,77 @@ NOTE(in_derived_witness, none,
58425842
(const ValueDecl *, DeclName, Type))
58435843

58445844
ERROR(non_sendable_arg_into_actor,none,
5845-
"non-sendable type %0 cannot be sent into %2 context in call to %kind1",
5845+
"non-Sendable type %0 cannot be sent into %2 context in call to %kind1",
58465846
(Type, const ValueDecl *, ActorIsolation))
58475847
ERROR(non_sendable_arg_exits_actor,none,
5848-
"non-sendable type %0 cannot exit %2 context in call to nonisolated "
5848+
"non-Sendable type %0 cannot exit %2 context in call to nonisolated "
58495849
"%kind1",
58505850
(Type, const ValueDecl *, ActorIsolation))
58515851
ERROR(non_sendable_param_in_witness,none,
5852-
"non-sendable parameter type %0 cannot be sent from caller of "
5852+
"non-Sendable parameter type %0 cannot be sent from caller of "
58535853
"protocol requirement %1 into %2 implementation",
58545854
(Type, const ValueDecl *, ActorIsolation))
58555855
ERROR(non_sendable_param_in_override,none,
5856-
"non-sendable parameter type %0 cannot be sent from caller of "
5856+
"non-Sendable parameter type %0 cannot be sent from caller of "
58575857
"superclass %kind1 into %2 override",
58585858
(Type, const ValueDecl *, ActorIsolation))
58595859
ERROR(non_sendable_param_in_objc,none,
5860-
"non-sendable parameter type %0 of %2 '@objc' %kind1 cannot cross actor "
5860+
"non-Sendable parameter type %0 of %2 '@objc' %kind1 cannot cross actor "
58615861
"boundary",
58625862
(Type, const ValueDecl *, ActorIsolation))
58635863

58645864
ERROR(non_sendable_result_into_actor,none,
5865-
"non-sendable result type %0 cannot be sent from %2 context in call "
5865+
"non-Sendable result type %0 cannot be sent from %2 context in call "
58665866
"to %kind1",
58675867
(Type, const ValueDecl *, ActorIsolation))
58685868
ERROR(non_sendable_result_exits_actor,none,
5869-
"non-sendable result type %0 cannot exit %2 context in call to "
5869+
"non-Sendable result type %0 cannot exit %2 context in call to "
58705870
"nonisolated %kind1",
58715871
(Type, const ValueDecl *, ActorIsolation))
58725872
ERROR(non_sendable_result_in_witness,none,
5873-
"non-sendable type %0 cannot be returned from %2 implementation "
5873+
"non-Sendable type %0 cannot be returned from %2 implementation "
58745874
"to caller of protocol requirement %1",
58755875
(Type, const ValueDecl *, ActorIsolation))
58765876
ERROR(non_sendable_result_in_override,none,
5877-
"non-sendable type %0 cannot be returned from %2 override to "
5877+
"non-Sendable type %0 cannot be returned from %2 override to "
58785878
"caller of superclass %kind1",
58795879
(Type, const ValueDecl *, ActorIsolation))
58805880
ERROR(non_sendable_result_in_objc,none,
5881-
"non-sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
5881+
"non-Sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
58825882
"actor boundary",
58835883
(Type, const ValueDecl *, ActorIsolation))
58845884

58855885
ERROR(non_sendable_call_result_type,none,
5886-
"non-sendable result type %0 cannot be sent from %1 context in call "
5886+
"non-Sendable result type %0 cannot be sent from %1 context in call "
58875887
"to async function",
58885888
(Type, ActorIsolation))
58895889

58905890
ERROR(non_sendable_property_exits_actor,none,
5891-
"non-sendable type %0 of %kind1 cannot exit %2 context",
5891+
"non-Sendable type %0 of %kind1 cannot exit %2 context",
58925892
(Type, const ValueDecl *, ActorIsolation))
58935893
ERROR(non_sendable_property_into_actor,none,
5894-
"non-sendable type %0 of nonisolated %kind1 cannot be sent to "
5894+
"non-Sendable type %0 of nonisolated %kind1 cannot be sent to "
58955895
"%2 context",
58965896
(Type, const ValueDecl *, ActorIsolation))
58975897
ERROR(non_sendable_property_in_witness,none,
5898-
"non-sendable type %0 cannot be returned from %2 implementation "
5898+
"non-Sendable type %0 cannot be returned from %2 implementation "
58995899
"to caller of protocol requirement %1",
59005900
(Type, const ValueDecl *, ActorIsolation))
59015901
ERROR(non_sendable_property_in_override,none,
5902-
"non-sendable type %0 cannot be returned from %2 override to "
5902+
"non-Sendable type %0 cannot be returned from %2 override to "
59035903
"caller of superclass %kind1",
59045904
(Type, const ValueDecl *, ActorIsolation))
59055905
ERROR(non_sendable_property_in_objc,none,
5906-
"non-sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
5906+
"non-Sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
59075907
"actor boundary",
59085908
(Type, const ValueDecl *, ActorIsolation))
59095909

59105910
ERROR(non_sendable_keypath_capture,none,
5911-
"cannot form key path that captures non-sendable type %0",
5911+
"cannot form key path that captures non-Sendable type %0",
59125912
(Type))
59135913
ERROR(non_concurrent_type_member,none,
59145914
"%select{stored property %2|associated value %2}1 of "
5915-
"'Sendable'-conforming %kind3 has non-sendable type %0",
5915+
"'Sendable'-conforming %kind3 has non-Sendable type %0",
59165916
(Type, bool, DeclName, const ValueDecl *))
59175917
ERROR(concurrent_value_class_mutable_property,none,
59185918
"stored property %0 of 'Sendable'-conforming %kind1 is mutable",
@@ -6011,7 +6011,7 @@ ERROR(nonisolated_lazy,none,
60116011
())
60126012

60136013
ERROR(non_sendable_from_deinit,none,
6014-
"cannot access %kind1 with a non-sendable type %0 from nonisolated "
6014+
"cannot access %kind1 with a non-Sendable type %0 from nonisolated "
60156015
"deinit",
60166016
(Type, const VarDecl *))
60176017

include/swift/Sema/Concurrency.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct DiagnosticBehavior;
3636
/// that the attribute be removed.
3737
void diagnoseUnnecessaryPreconcurrencyImports(SourceFile &sf);
3838

39-
/// Diagnose the use of an instance property of non-sendable type from an
39+
/// Diagnose the use of an instance property of non-Sendable type from an
4040
/// nonisolated deinitializer within an actor-isolated type.
4141
///
4242
/// \returns true iff a diagnostic was emitted for this reference.

test/ClangImporter/objc_async.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,22 @@ func testSendableAttrs(
137137

138138
doSomethingConcurrently {
139139
print(sendableClass) // no-error
140-
print(nonSendableClass) // expected-warning{{capture of 'nonSendableClass' with non-sendable type 'NonSendableClass' in a '@Sendable' closure}}
140+
print(nonSendableClass) // expected-warning{{capture of 'nonSendableClass' with non-Sendable type 'NonSendableClass' in a '@Sendable' closure}}
141141

142142
print(sendableEnum) // no-error
143-
print(nonSendableEnum) // expected-warning{{capture of 'nonSendableEnum' with non-sendable type 'NonSendableEnum' in a '@Sendable' closure}}
143+
print(nonSendableEnum) // expected-warning{{capture of 'nonSendableEnum' with non-Sendable type 'NonSendableEnum' in a '@Sendable' closure}}
144144

145145
print(sendableOptions) // no-error
146-
print(nonSendableOptions) // expected-warning{{capture of 'nonSendableOptions' with non-sendable type 'NonSendableOptions' in a '@Sendable' closure}}
146+
print(nonSendableOptions) // expected-warning{{capture of 'nonSendableOptions' with non-Sendable type 'NonSendableOptions' in a '@Sendable' closure}}
147147

148148
print(sendableError) // no-error
149149
print(nonSendableError) // no-error--we don't respect `@_nonSendable` on `ns_error_domain` types because all errors are Sendable
150150

151151
print(sendableStringEnum) // no-error
152-
print(nonSendableStringEnum) // expected-warning{{capture of 'nonSendableStringEnum' with non-sendable type 'NonSendableStringEnum' in a '@Sendable' closure}}
152+
print(nonSendableStringEnum) // expected-warning{{capture of 'nonSendableStringEnum' with non-Sendable type 'NonSendableStringEnum' in a '@Sendable' closure}}
153153

154154
print(sendableStringStruct) // no-error
155-
print(nonSendableStringStruct) // expected-warning{{capture of 'nonSendableStringStruct' with non-sendable type 'NonSendableStringStruct' in a '@Sendable' closure}}
155+
print(nonSendableStringStruct) // expected-warning{{capture of 'nonSendableStringStruct' with non-Sendable type 'NonSendableStringStruct' in a '@Sendable' closure}}
156156
}
157157
}
158158

test/Concurrency/actor_call_implicitly_async.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ func someAsyncFunc() async {
176176
////////////
177177
// effectful properties from outside the actor instance
178178

179-
// expected-warning@+2 {{non-sendable type 'Box' of property 'effPropA' cannot exit actor-isolated context}}
179+
// expected-warning@+2 {{non-Sendable type 'Box' of property 'effPropA' cannot exit actor-isolated context}}
180180
// expected-error@+1{{expression is 'async' but is not marked with 'await'}} {{7-7=await }} expected-note@+1{{property access is 'async'}}
181181
_ = a.effPropA
182182

183-
// expected-warning@+3 {{non-sendable type 'Box' of property 'effPropT' cannot exit actor-isolated context}}
183+
// expected-warning@+3 {{non-Sendable type 'Box' of property 'effPropT' cannot exit actor-isolated context}}
184184
// expected-error@+2{{property access can throw, but it is not marked with 'try' and the error is not handled}}
185185
// expected-error@+1{{expression is 'async' but is not marked with 'await'}} {{7-7=await }} expected-note@+1{{property access is 'async'}}
186186
_ = a.effPropT
@@ -190,8 +190,8 @@ func someAsyncFunc() async {
190190
_ = a.effPropAT
191191

192192
// (mostly) corrected ones
193-
_ = await a.effPropA // expected-warning {{non-sendable type 'Box' of property 'effPropA' cannot exit actor-isolated context}}
194-
_ = try! await a.effPropT // expected-warning {{non-sendable type 'Box' of property 'effPropT' cannot exit actor-isolated context}}
193+
_ = await a.effPropA // expected-warning {{non-Sendable type 'Box' of property 'effPropA' cannot exit actor-isolated context}}
194+
_ = try! await a.effPropT // expected-warning {{non-Sendable type 'Box' of property 'effPropT' cannot exit actor-isolated context}}
195195
_ = try? await a.effPropAT
196196

197197
print("ok!")

test/Concurrency/actor_inout_isolation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ extension TestActor {
119119
func passStateIntoDifferentClassMethod() async {
120120
let other = NonAsyncClass()
121121
let otherCurry = other.modifyOtherAsync
122-
// expected-targeted-complete-tns-warning @-1 {{non-sendable type 'NonAsyncClass' cannot exit actor-isolated context in call to nonisolated instance method 'modifyOtherAsync'}}
122+
// expected-targeted-complete-tns-warning @-1 {{non-Sendable type 'NonAsyncClass' cannot exit actor-isolated context in call to nonisolated instance method 'modifyOtherAsync'}}
123123
await other.modifyOtherAsync(&value2)
124124
// expected-error @-1 {{actor-isolated property 'value2' cannot be passed 'inout' to 'async' function call}}
125125

@@ -288,11 +288,11 @@ actor ProtectArray {
288288
func test() async {
289289
// FIXME: this is invalid too!
290290
_ = await array.mutateAsynchronously
291-
// expected-targeted-complete-tns-warning@-1 {{non-sendable type '@lvalue [Int]' cannot exit actor-isolated context in call to nonisolated property 'mutateAsynchronously'}}
291+
// expected-targeted-complete-tns-warning@-1 {{non-Sendable type '@lvalue [Int]' cannot exit actor-isolated context in call to nonisolated property 'mutateAsynchronously'}}
292292

293293
_ = await array[mutateAsynchronously: 0]
294294
// expected-error@-1 {{actor-isolated property 'array' cannot be passed 'inout' to 'async' function call}}
295-
// expected-targeted-complete-tns-warning@-2 {{non-sendable type 'inout Array<Int>' cannot exit actor-isolated context in call to nonisolated subscript 'subscript(mutateAsynchronously:)'}}
295+
// expected-targeted-complete-tns-warning@-2 {{non-Sendable type 'inout Array<Int>' cannot exit actor-isolated context in call to nonisolated subscript 'subscript(mutateAsynchronously:)'}}
296296

297297
await passToAsync(array[0])
298298

0 commit comments

Comments
 (0)