@@ -315,12 +315,12 @@ ERROR(missing_never_call_closure,none,
315
315
(Type))
316
316
317
317
ERROR(missing_return_decl,none,
318
- " missing return in %1 expected to return %0" ,
319
- (Type, DescriptiveDeclKind ))
318
+ " missing return in %kindonly1 expected to return %0" ,
319
+ (Type, const AbstractFunctionDecl * ))
320
320
ERROR(missing_never_call_decl,none,
321
- " %1 with uninhabited return type %0 is missing "
321
+ " %kindonly1 with uninhabited return type %0 is missing "
322
322
" call to another never-returning function on all paths" ,
323
- (Type, DescriptiveDeclKind ))
323
+ (Type, const AbstractFunctionDecl * ))
324
324
325
325
NOTE(missing_return_last_expr_note,none,
326
326
" did you mean to return the last expression?" , ())
@@ -701,8 +701,9 @@ WARNING(warning_int_to_fp_inexact, none,
701
701
702
702
// Flow-isolation diagnostics
703
703
ERROR(isolated_after_nonisolated, none,
704
- " cannot access %1 %2 here in %select{nonisolated initializer|deinitializer}0" ,
705
- (bool , DescriptiveDeclKind, DeclName))
704
+ " cannot access %kind1 here in "
705
+ " %select{nonisolated initializer|deinitializer}0" ,
706
+ (bool , const ValueDecl *))
706
707
NOTE(nonisolated_blame, none, " after %1%2 %3, "
707
708
" only nonisolated properties of 'self' can be accessed from "
708
709
" %select{this init|a deinit}0" , (bool , StringRef, StringRef, DeclName))
@@ -982,23 +983,23 @@ GROUPED_ERROR(regionbasedisolation_type_send_yields_race, SendingRisksDataRace,
982
983
(Type))
983
984
NOTE(regionbasedisolation_type_use_after_send, none,
984
985
" sending value of non-Sendable type %0 to %1 callee risks causing data races between %1 and local %2 uses" ,
985
- (Type, ActorIsolation, ActorIsolation ))
986
+ (Type, StringRef, StringRef ))
986
987
NOTE(regionbasedisolation_type_use_after_send_callee, none,
987
- " sending value of non-Sendable type %0 to %1 %2 %3 risks causing data "
988
- " races between %1 and local %4 uses" ,
989
- (Type, ActorIsolation, DescriptiveDeclKind, DeclName, ActorIsolation ))
988
+ " sending value of non-Sendable type %0 to %1 %kind2 risks causing data "
989
+ " races between %1 and local %3 uses" ,
990
+ (Type, StringRef, const ValueDecl *, StringRef ))
990
991
991
992
NOTE(regionbasedisolation_named_info_send_yields_race, none,
992
- " sending %1%0 to %2 callee risks causing data races between %2 and local %3 uses" ,
993
- (Identifier, StringRef, ActorIsolation, ActorIsolation ))
993
+ " sending %select{%2 |}0%1 to %3 callee risks causing data races between %3 and local %4 uses" ,
994
+ (bool , Identifier, StringRef, StringRef, StringRef ))
994
995
NOTE(regionbasedisolation_named_info_send_yields_race_callee, none,
995
- " sending %1%0 to %2 % 3 %4 risks causing data races between %2 and local %5 uses" ,
996
- (Identifier, StringRef, ActorIsolation, DescriptiveDeclKind, DeclName, ActorIsolation ))
996
+ " sending %select{%2 |}0%1 to %3 %kind4 risks causing data races between %3 and local %5 uses" ,
997
+ (bool , Identifier, StringRef, StringRef, const ValueDecl *, StringRef ))
997
998
998
999
// Use after send closure.
999
1000
NOTE(regionbasedisolation_type_isolated_capture_yields_race, none,
1000
1001
" sending value of non-Sendable type %0 to %1 closure due to closure capture risks causing races in between %1 and %2 uses" ,
1001
- (Type, ActorIsolation, ActorIsolation ))
1002
+ (Type, StringRef, StringRef ))
1002
1003
1003
1004
// Value captured in async let and reused.
1004
1005
NOTE(regionbasedisolation_named_nonisolated_asynclet_name, none,
@@ -1009,33 +1010,33 @@ NOTE(regionbasedisolation_named_value_used_after_explicit_sending, none,
1009
1010
" %0 used after being passed as a 'sending' parameter; Later uses could race" ,
1010
1011
(Identifier))
1011
1012
NOTE(regionbasedisolation_named_isolated_closure_yields_race, none,
1012
- " %0 %1 is captured by a %2 closure. %2 uses in closure may race against later %3 uses" ,
1013
- (StringRef, Identifier, ActorIsolation, ActorIsolation ))
1013
+ " %select{ %1 |}0%2 is captured by a %3 closure. %3 uses in closure may race against later %4 uses" ,
1014
+ (bool , StringRef, Identifier, StringRef, StringRef ))
1014
1015
1015
1016
NOTE(regionbasedisolation_typed_use_after_sending, none,
1016
1017
" Passing value of non-Sendable type %0 as a 'sending' argument risks causing races in between local and caller code" ,
1017
1018
(Type))
1018
1019
NOTE(regionbasedisolation_typed_use_after_sending_callee, none,
1019
- " Passing value of non-Sendable type %0 as a 'sending' argument to %1 %2 risks causing races in between local and caller code" ,
1020
- (Type, DescriptiveDeclKind, DeclName ))
1020
+ " Passing value of non-Sendable type %0 as a 'sending' argument to %kind1 risks causing races in between local and caller code" ,
1021
+ (Type, const ValueDecl * ))
1021
1022
1022
1023
// ===
1023
1024
// Sending Never Sendable Emitter
1024
1025
1025
1026
NOTE(regionbasedisolation_named_send_never_sendable, none,
1026
- " sending %1%0 to %2 callee risks causing data races between %2 and %3 uses" ,
1027
- (Identifier, StringRef, ActorIsolation , StringRef))
1027
+ " sending %select{%2 |}0%1 to %3 callee risks causing data races between %3 and %4 uses" ,
1028
+ (bool , Identifier, StringRef, StringRef , StringRef))
1028
1029
NOTE(regionbasedisolation_named_send_never_sendable_callee, none,
1029
- " sending %1%0 to %2 % 3 %4 risks causing data races between %2 and %5 uses" ,
1030
- (Identifier, StringRef, ActorIsolation, DescriptiveDeclKind, DeclName , StringRef))
1030
+ " sending %select{%2 |}0%1 to %3 %kind4 risks causing data races between %3 and %5 uses" ,
1031
+ (bool , Identifier, StringRef, StringRef, const ValueDecl * , StringRef))
1031
1032
1032
1033
NOTE(regionbasedisolation_named_send_into_sending_param, none,
1033
- " %0%1 is passed as a 'sending' parameter; Uses in callee may race with "
1034
- " later %0uses " ,
1035
- (StringRef, Identifier))
1034
+ " %select{%1 |}0%2 is passed as a 'sending' parameter; Uses in callee may race with "
1035
+ " later %1 uses " ,
1036
+ (bool , StringRef, Identifier))
1036
1037
NOTE(regionbasedisolation_named_nosend_send_into_result, none,
1037
- " %0 %1 cannot be a 'sending' result. %2 uses may race with caller uses" ,
1038
- (StringRef, Identifier, StringRef))
1038
+ " %select{ %1 |}0%2 cannot be a 'sending' result. %3 uses may race with caller uses" ,
1039
+ (bool , StringRef, Identifier, StringRef))
1039
1040
NOTE(regionbasedisolation_typed_tns_passed_to_sending, none,
1040
1041
" Passing %0 value of non-Sendable type %1 as a 'sending' parameter risks "
1041
1042
" causing races inbetween %0 uses and uses reachable from the callee" ,
@@ -1051,8 +1052,8 @@ NOTE(regionbasedisolation_typed_tns_passed_to_sending_closure_helper_have_value_
1051
1052
" closure captures %0 which is accessible to code in the current task" ,
1052
1053
(DeclName))
1053
1054
NOTE(regionbasedisolation_typed_tns_passed_to_sending_closure_helper_have_boxed_value_task_isolated, none,
1054
- " closure captures reference to mutable %1 %0 which is accessible to code in the current task" ,
1055
- (DeclName, DescriptiveDeclKind ))
1055
+ " closure captures reference to mutable %kind0 which is accessible to code in the current task" ,
1056
+ (const ValueDecl * ))
1056
1057
NOTE(regionbasedisolation_typed_tns_passed_to_sending_closure_helper_have_value_region, none,
1057
1058
" closure captures %1 which is accessible to %0 code" ,
1058
1059
(StringRef, DeclName))
@@ -1068,18 +1069,18 @@ NOTE(regionbasedisolation_closure_captures_actor, none,
1068
1069
(DeclName, StringRef))
1069
1070
1070
1071
NOTE(regionbasedisolation_typed_tns_passed_to_sending_callee, none,
1071
- " 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 " ,
1072
- (StringRef, Type, DescriptiveDeclKind, DeclName ))
1072
+ " Passing %0 value of non-Sendable type %1 as a 'sending' parameter to %kind2 risks causing races inbetween %0 uses and uses reachable from %2 " ,
1073
+ (StringRef, Type, const ValueDecl * ))
1073
1074
1074
1075
NOTE(regionbasedisolation_named_send_nt_asynclet_capture, none,
1075
1076
" sending %1 %0 into async let risks causing data races between nonisolated and %1 uses" ,
1076
1077
(Identifier, StringRef))
1077
1078
NOTE(regionbasedisolation_typed_sendneversendable_via_arg, none,
1078
1079
" sending %0 value of non-Sendable type %1 to %2 callee risks causing races in between %0 and %2 uses" ,
1079
- (StringRef, Type, ActorIsolation ))
1080
+ (StringRef, Type, StringRef ))
1080
1081
NOTE(regionbasedisolation_typed_sendneversendable_via_arg_callee, none,
1081
- " sending %0 value of non-Sendable type %1 to %2 %3 %4 risks causing races in between %0 and %2 uses" ,
1082
- (StringRef, Type, ActorIsolation, DescriptiveDeclKind, DeclName ))
1082
+ " sending %0 value of non-Sendable type %1 to %2 %kind3 risks causing races in between %0 and %2 uses" ,
1083
+ (StringRef, Type, StringRef, const ValueDecl * ))
1083
1084
1084
1085
NOTE(regionbasedisolation_isolated_conformance_introduced, none,
1085
1086
" isolated conformance to %kind0 can be introduced here" ,
@@ -1097,10 +1098,10 @@ NOTE(regionbasedisolation_inout_sending_must_be_reinitialized, none,
1097
1098
" 'inout sending' parameter must be reinitialized before function exit with a non-actor isolated value" ,
1098
1099
())
1099
1100
ERROR(regionbasedisolation_inout_sending_cannot_be_actor_isolated, none,
1100
- " 'inout sending' parameter %0 cannot be %1at end of function" ,
1101
+ " 'inout sending' parameter %0 cannot be %1 at end of function" ,
1101
1102
(Identifier, StringRef))
1102
1103
NOTE(regionbasedisolation_inout_sending_cannot_be_actor_isolated_note, none,
1103
- " %1%0 risks causing races in between %1uses and caller uses since caller assumes value is not actor isolated" ,
1104
+ " %1 %0 risks causing races in between %1 uses and caller uses since caller assumes value is not actor isolated" ,
1104
1105
(Identifier, StringRef))
1105
1106
1106
1107
// ===
@@ -1125,10 +1126,10 @@ NOTE(regionbasedisolation_out_sending_cannot_be_actor_isolated_note_named, none,
1125
1126
// Example: returning main-actor isolated result to a custom-actor isolated context risks causing data races
1126
1127
ERROR(rbi_isolation_crossing_result, none,
1127
1128
" non-Sendable %0-typed result can not be returned from %1 %kind2 to %3 context" ,
1128
- (Type, ActorIsolation , const ValueDecl *, ActorIsolation ))
1129
+ (Type, StringRef , const ValueDecl *, StringRef ))
1129
1130
ERROR(rbi_isolation_crossing_result_no_decl, none,
1130
1131
" non-Sendable %0-typed result can not be returned from %1 function to %2 context" ,
1131
- (Type, ActorIsolation, ActorIsolation ))
1132
+ (Type, StringRef, StringRef ))
1132
1133
NOTE(rbi_non_sendable_nominal,none,
1133
1134
" %kind0 does not conform to the 'Sendable' protocol" ,
1134
1135
(const ValueDecl *))
0 commit comments