Skip to content

Commit 81b94e2

Browse files
authored
Merge pull request #81748 from gottesmm/release/6.2-151802975
[6.2][sema] Change non-sendable -> non-Sendable in diagnostics.
2 parents 1be78c5 + b8cf5ae commit 81b94e2

File tree

55 files changed

+570
-570
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

+570
-570
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
@@ -4985,28 +4985,28 @@ NOTE(silence_debug_description_in_interpolation_segment_call,none,
49854985
"use 'String(describing:)' to silence this warning", ())
49864986

49874987
NOTE(noescape_parameter,none,
4988-
"parameter %1 is implicitly %select{non-escaping|non-sendable}0",
4988+
"parameter %1 is implicitly %select{non-escaping|non-Sendable}0",
49894989
(unsigned, Identifier))
49904990
NOTE(generic_parameters_always_escaping,none,
49914991
"generic parameters are always considered '@escaping'", ())
49924992

49934993
ERROR(passing_noattrfunc_to_attrfunc,none,
4994-
"passing %select{non-escaping|non-sendable}0 parameter %1 to function "
4994+
"passing %select{non-escaping|non-Sendable}0 parameter %1 to function "
49954995
"expecting %select{an '@escaping'|a '@Sendable'}0 closure",
49964996
(unsigned, Identifier))
49974997
ERROR(converting_noescape_param_to_generic_type,none,
49984998
"converting non-escaping parameter %0 to generic parameter %1 may allow it to escape",
49994999
(Identifier, Type))
50005000
ERROR(assigning_noattrfunc_to_attrfunc,none,
5001-
"assigning %select{non-escaping|non-sendable}0 parameter %1 to "
5001+
"assigning %select{non-escaping|non-Sendable}0 parameter %1 to "
50025002
"%select{an '@escaping'|a '@Sendable'}0 closure",
50035003
(unsigned, Identifier))
50045004
ERROR(general_noattrfunc_to_attr,none,
5005-
"using %select{non-escaping|non-sendable}0 parameter %1 in a context "
5005+
"using %select{non-escaping|non-Sendable}0 parameter %1 in a context "
50065006
"expecting %select{an '@escaping'|a '@Sendable'}0 closure",
50075007
(unsigned, Identifier))
50085008
ERROR(converting_noattrfunc_to_type,none,
5009-
"converting %select{non-escaping|non-sendable function}0 value to %1 "
5009+
"converting %select{non-escaping|non-Sendable function}0 value to %1 "
50105010
"may %select{allow it to escape|introduce data races}0",
50115011
(unsigned, Type))
50125012
NOTE(escape_expected_at_parameter_position,none,
@@ -5649,15 +5649,15 @@ GROUPED_ERROR(concurrent_access_of_inout_param,SendableClosureCaptures,none,
56495649
"concurrently-executing code",
56505650
(DeclName))
56515651
GROUPED_ERROR(non_sendable_capture,SendableClosureCaptures,none,
5652-
"capture of %1 with non-sendable type %0 in a '@Sendable' "
5652+
"capture of %1 with non-Sendable type %0 in a '@Sendable' "
56535653
"%select{local function|closure}2",
56545654
(Type, DeclName, bool))
56555655
ERROR(non_sendable_isolated_capture,none,
5656-
"capture of %1 with non-sendable type %0 in an isolated "
5656+
"capture of %1 with non-Sendable type %0 in an isolated "
56575657
"%select{local function|closure}2",
56585658
(Type, DeclName, bool))
56595659
ERROR(non_sendable_metatype_capture,none,
5660-
"capture of non-sendable type %0 in an isolated "
5660+
"capture of non-Sendable type %0 in an isolated "
56615661
"%select{local function|closure}1",
56625662
(Type, bool))
56635663
ERROR(self_capture_deinit_task,none,
@@ -5793,77 +5793,77 @@ NOTE(in_derived_witness, none,
57935793
(DescriptiveDeclKind, DeclName, Type))
57945794

57955795
ERROR(non_sendable_arg_into_actor,none,
5796-
"non-sendable type %0 cannot be sent into %2 context in call to %kind1",
5796+
"non-Sendable type %0 cannot be sent into %2 context in call to %kind1",
57975797
(Type, const ValueDecl *, ActorIsolation))
57985798
ERROR(non_sendable_arg_exits_actor,none,
5799-
"non-sendable type %0 cannot exit %2 context in call to nonisolated "
5799+
"non-Sendable type %0 cannot exit %2 context in call to nonisolated "
58005800
"%kind1",
58015801
(Type, const ValueDecl *, ActorIsolation))
58025802
ERROR(non_sendable_param_in_witness,none,
5803-
"non-sendable parameter type %0 cannot be sent from caller of "
5803+
"non-Sendable parameter type %0 cannot be sent from caller of "
58045804
"protocol requirement %1 into %2 implementation",
58055805
(Type, const ValueDecl *, ActorIsolation))
58065806
ERROR(non_sendable_param_in_override,none,
5807-
"non-sendable parameter type %0 cannot be sent from caller of "
5807+
"non-Sendable parameter type %0 cannot be sent from caller of "
58085808
"superclass %kind1 into %2 override",
58095809
(Type, const ValueDecl *, ActorIsolation))
58105810
ERROR(non_sendable_param_in_objc,none,
5811-
"non-sendable parameter type %0 of %2 '@objc' %kind1 cannot cross actor "
5811+
"non-Sendable parameter type %0 of %2 '@objc' %kind1 cannot cross actor "
58125812
"boundary",
58135813
(Type, const ValueDecl *, ActorIsolation))
58145814

58155815
ERROR(non_sendable_result_into_actor,none,
5816-
"non-sendable result type %0 cannot be sent from %2 context in call "
5816+
"non-Sendable result type %0 cannot be sent from %2 context in call "
58175817
"to %kind1",
58185818
(Type, const ValueDecl *, ActorIsolation))
58195819
ERROR(non_sendable_result_exits_actor,none,
5820-
"non-sendable result type %0 cannot exit %2 context in call to "
5820+
"non-Sendable result type %0 cannot exit %2 context in call to "
58215821
"nonisolated %kind1",
58225822
(Type, const ValueDecl *, ActorIsolation))
58235823
ERROR(non_sendable_result_in_witness,none,
5824-
"non-sendable type %0 cannot be returned from %2 implementation "
5824+
"non-Sendable type %0 cannot be returned from %2 implementation "
58255825
"to caller of protocol requirement %1",
58265826
(Type, const ValueDecl *, ActorIsolation))
58275827
ERROR(non_sendable_result_in_override,none,
5828-
"non-sendable type %0 cannot be returned from %2 override to "
5828+
"non-Sendable type %0 cannot be returned from %2 override to "
58295829
"caller of superclass %kind1",
58305830
(Type, const ValueDecl *, ActorIsolation))
58315831
ERROR(non_sendable_result_in_objc,none,
5832-
"non-sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
5832+
"non-Sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
58335833
"actor boundary",
58345834
(Type, const ValueDecl *, ActorIsolation))
58355835

58365836
ERROR(non_sendable_call_result_type,none,
5837-
"non-sendable result type %0 cannot be sent from %1 context in call "
5837+
"non-Sendable result type %0 cannot be sent from %1 context in call "
58385838
"to async function",
58395839
(Type, ActorIsolation))
58405840

58415841
ERROR(non_sendable_property_exits_actor,none,
5842-
"non-sendable type %0 of %kind1 cannot exit %2 context",
5842+
"non-Sendable type %0 of %kind1 cannot exit %2 context",
58435843
(Type, const ValueDecl *, ActorIsolation))
58445844
ERROR(non_sendable_property_into_actor,none,
5845-
"non-sendable type %0 of nonisolated %kind1 cannot be sent to "
5845+
"non-Sendable type %0 of nonisolated %kind1 cannot be sent to "
58465846
"%2 context",
58475847
(Type, const ValueDecl *, ActorIsolation))
58485848
ERROR(non_sendable_property_in_witness,none,
5849-
"non-sendable type %0 cannot be returned from %2 implementation "
5849+
"non-Sendable type %0 cannot be returned from %2 implementation "
58505850
"to caller of protocol requirement %1",
58515851
(Type, const ValueDecl *, ActorIsolation))
58525852
ERROR(non_sendable_property_in_override,none,
5853-
"non-sendable type %0 cannot be returned from %2 override to "
5853+
"non-Sendable type %0 cannot be returned from %2 override to "
58545854
"caller of superclass %kind1",
58555855
(Type, const ValueDecl *, ActorIsolation))
58565856
ERROR(non_sendable_property_in_objc,none,
5857-
"non-sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
5857+
"non-Sendable type %0 returned by %2 '@objc' %kind1 cannot cross "
58585858
"actor boundary",
58595859
(Type, const ValueDecl *, ActorIsolation))
58605860

58615861
ERROR(non_sendable_keypath_capture,none,
5862-
"cannot form key path that captures non-sendable type %0",
5862+
"cannot form key path that captures non-Sendable type %0",
58635863
(Type))
58645864
ERROR(non_concurrent_type_member,none,
58655865
"%select{stored property %2|associated value %2}1 of "
5866-
"'Sendable'-conforming %kind3 has non-sendable type %0",
5866+
"'Sendable'-conforming %kind3 has non-Sendable type %0",
58675867
(Type, bool, DeclName, const ValueDecl *))
58685868
ERROR(concurrent_value_class_mutable_property,none,
58695869
"stored property %0 of 'Sendable'-conforming %kind1 is mutable",
@@ -5957,7 +5957,7 @@ ERROR(nonisolated_lazy,none,
59575957
())
59585958

59595959
ERROR(non_sendable_from_deinit,none,
5960-
"cannot access %1 %2 with a non-sendable type %0 from nonisolated deinit",
5960+
"cannot access %1 %2 with a non-Sendable type %0 from nonisolated deinit",
59615961
(Type, DescriptiveDeclKind, DeclName))
59625962

59635963
ERROR(actor_instance_property_wrapper,none,

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{{actor-isolated property 'effPropA' cannot be accessed from outside of the actor}} {{7-7=await }}
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{{actor-isolated property 'effPropT' cannot be accessed from outside of the actor}} {{7-7=await }}
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)