Skip to content

Commit a4db152

Browse files
committed
[sema] Change non-sendable -> non-Sendable in diagnostics.
This matches send non sendable but importantly also makes it clear that we are talking about something that doesn't conform to the Sendable protocol which is capitalized. rdar://151802975
1 parent e805d93 commit a4db152

File tree

55 files changed

+573
-573
lines changed

Some content is hidden

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

55 files changed

+573
-573
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
@@ -5008,28 +5008,28 @@ NOTE(silence_debug_description_in_interpolation_segment_call,none,
50085008
"use 'String(describing:)' to silence this warning", ())
50095009

50105010
NOTE(noescape_parameter,none,
5011-
"parameter %1 is implicitly %select{non-escaping|non-sendable}0",
5011+
"parameter %1 is implicitly %select{non-escaping|non-Sendable}0",
50125012
(unsigned, Identifier))
50135013
NOTE(generic_parameters_always_escaping,none,
50145014
"generic parameters are always considered '@escaping'", ())
50155015

50165016
ERROR(passing_noattrfunc_to_attrfunc,none,
5017-
"passing %select{non-escaping|non-sendable}0 parameter %1 to function "
5017+
"passing %select{non-escaping|non-Sendable}0 parameter %1 to function "
50185018
"expecting %select{an '@escaping'|a '@Sendable'}0 closure",
50195019
(unsigned, Identifier))
50205020
ERROR(converting_noescape_param_to_generic_type,none,
50215021
"converting non-escaping parameter %0 to generic parameter %1 may allow it to escape",
50225022
(Identifier, Type))
50235023
ERROR(assigning_noattrfunc_to_attrfunc,none,
5024-
"assigning %select{non-escaping|non-sendable}0 parameter %1 to "
5024+
"assigning %select{non-escaping|non-Sendable}0 parameter %1 to "
50255025
"%select{an '@escaping'|a '@Sendable'}0 closure",
50265026
(unsigned, Identifier))
50275027
ERROR(general_noattrfunc_to_attr,none,
5028-
"using %select{non-escaping|non-sendable}0 parameter %1 in a context "
5028+
"using %select{non-escaping|non-Sendable}0 parameter %1 in a context "
50295029
"expecting %select{an '@escaping'|a '@Sendable'}0 closure",
50305030
(unsigned, Identifier))
50315031
ERROR(converting_noattrfunc_to_type,none,
5032-
"converting %select{non-escaping|non-sendable function}0 value to %1 "
5032+
"converting %select{non-escaping|non-Sendable function}0 value to %1 "
50335033
"may %select{allow it to escape|introduce data races}0",
50345034
(unsigned, Type))
50355035
NOTE(escape_expected_at_parameter_position,none,
@@ -5672,15 +5672,15 @@ GROUPED_ERROR(concurrent_access_of_inout_param,SendableClosureCaptures,none,
56725672
"concurrently-executing code",
56735673
(DeclName))
56745674
GROUPED_ERROR(non_sendable_capture,SendableClosureCaptures,none,
5675-
"capture of %1 with non-sendable type %0 in a '@Sendable' "
5675+
"capture of %1 with non-Sendable type %0 in a '@Sendable' "
56765676
"%select{local function|closure}2",
56775677
(Type, DeclName, bool))
56785678
ERROR(non_sendable_isolated_capture,none,
5679-
"capture of %1 with non-sendable type %0 in an isolated "
5679+
"capture of %1 with non-Sendable type %0 in an isolated "
56805680
"%select{local function|closure}2",
56815681
(Type, DeclName, bool))
56825682
ERROR(non_sendable_metatype_capture,none,
5683-
"capture of non-sendable type %0 in an isolated "
5683+
"capture of non-Sendable type %0 in an isolated "
56845684
"%select{local function|closure}1",
56855685
(Type, bool))
56865686
ERROR(self_capture_deinit_task,none,
@@ -5817,77 +5817,77 @@ NOTE(in_derived_witness, none,
58175817
(const ValueDecl *, DeclName, Type))
58185818

58195819
ERROR(non_sendable_arg_into_actor,none,
5820-
"non-sendable type %0 cannot be sent into %2 context in call to %kind1",
5820+
"non-Sendable type %0 cannot be sent into %2 context in call to %kind1",
58215821
(Type, const ValueDecl *, ActorIsolation))
58225822
ERROR(non_sendable_arg_exits_actor,none,
5823-
"non-sendable type %0 cannot exit %2 context in call to nonisolated "
5823+
"non-Sendable type %0 cannot exit %2 context in call to nonisolated "
58245824
"%kind1",
58255825
(Type, const ValueDecl *, ActorIsolation))
58265826
ERROR(non_sendable_param_in_witness,none,
5827-
"non-sendable parameter type %0 cannot be sent from caller of "
5827+
"non-Sendable parameter type %0 cannot be sent from caller of "
58285828
"protocol requirement %1 into %2 implementation",
58295829
(Type, const ValueDecl *, ActorIsolation))
58305830
ERROR(non_sendable_param_in_override,none,
5831-
"non-sendable parameter type %0 cannot be sent from caller of "
5831+
"non-Sendable parameter type %0 cannot be sent from caller of "
58325832
"superclass %kind1 into %2 override",
58335833
(Type, const ValueDecl *, ActorIsolation))
58345834
ERROR(non_sendable_param_in_objc,none,
5835-
"non-sendable parameter type %0 of %2 '@objc' %kind1 cannot cross actor "
5835+
"non-Sendable parameter type %0 of %2 '@objc' %kind1 cannot cross actor "
58365836
"boundary",
58375837
(Type, const ValueDecl *, ActorIsolation))
58385838

58395839
ERROR(non_sendable_result_into_actor,none,
5840-
"non-sendable result type %0 cannot be sent from %2 context in call "
5840+
"non-Sendable result type %0 cannot be sent from %2 context in call "
58415841
"to %kind1",
58425842
(Type, const ValueDecl *, ActorIsolation))
58435843
ERROR(non_sendable_result_exits_actor,none,
5844-
"non-sendable result type %0 cannot exit %2 context in call to "
5844+
"non-Sendable result type %0 cannot exit %2 context in call to "
58455845
"nonisolated %kind1",
58465846
(Type, const ValueDecl *, ActorIsolation))
58475847
ERROR(non_sendable_result_in_witness,none,
5848-
"non-sendable type %0 cannot be returned from %2 implementation "
5848+
"non-Sendable type %0 cannot be returned from %2 implementation "
58495849
"to caller of protocol requirement %1",
58505850
(Type, const ValueDecl *, ActorIsolation))
58515851
ERROR(non_sendable_result_in_override,none,
5852-
"non-sendable type %0 cannot be returned from %2 override to "
5852+
"non-Sendable type %0 cannot be returned from %2 override to "
58535853
"caller of superclass %kind1",
58545854
(Type, const ValueDecl *, ActorIsolation))
58555855
ERROR(non_sendable_result_in_objc,none,
5856-
"non-sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
5856+
"non-Sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
58575857
"actor boundary",
58585858
(Type, const ValueDecl *, ActorIsolation))
58595859

58605860
ERROR(non_sendable_call_result_type,none,
5861-
"non-sendable result type %0 cannot be sent from %1 context in call "
5861+
"non-Sendable result type %0 cannot be sent from %1 context in call "
58625862
"to async function",
58635863
(Type, ActorIsolation))
58645864

58655865
ERROR(non_sendable_property_exits_actor,none,
5866-
"non-sendable type %0 of %kind1 cannot exit %2 context",
5866+
"non-Sendable type %0 of %kind1 cannot exit %2 context",
58675867
(Type, const ValueDecl *, ActorIsolation))
58685868
ERROR(non_sendable_property_into_actor,none,
5869-
"non-sendable type %0 of nonisolated %kind1 cannot be sent to "
5869+
"non-Sendable type %0 of nonisolated %kind1 cannot be sent to "
58705870
"%2 context",
58715871
(Type, const ValueDecl *, ActorIsolation))
58725872
ERROR(non_sendable_property_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_property_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_property_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_keypath_capture,none,
5886-
"cannot form key path that captures non-sendable type %0",
5886+
"cannot form key path that captures non-Sendable type %0",
58875887
(Type))
58885888
ERROR(non_concurrent_type_member,none,
58895889
"%select{stored property %2|associated value %2}1 of "
5890-
"'Sendable'-conforming %kind3 has non-sendable type %0",
5890+
"'Sendable'-conforming %kind3 has non-Sendable type %0",
58915891
(Type, bool, DeclName, const ValueDecl *))
58925892
ERROR(concurrent_value_class_mutable_property,none,
58935893
"stored property %0 of 'Sendable'-conforming %kind1 is mutable",
@@ -5986,7 +5986,7 @@ ERROR(nonisolated_lazy,none,
59865986
())
59875987

59885988
ERROR(non_sendable_from_deinit,none,
5989-
"cannot access %kind1 with a non-sendable type %0 from nonisolated "
5989+
"cannot access %kind1 with a non-Sendable type %0 from nonisolated "
59905990
"deinit",
59915991
(Type, const VarDecl *))
59925992

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)