@@ -5792,22 +5792,19 @@ ERROR(non_sendable_type,none,
5792
5792
ERROR(sendable_raw_storage,none,
5793
5793
" struct %0 with @_rawLayout does not conform to the 'Sendable' protocol" , (DeclName))
5794
5794
5795
+ ERROR(typeattr_not_inheritance_clause,none,
5796
+ " '%0' attribute only applies in inheritance clauses" , (StringRef))
5797
+ ERROR(typeattr_not_existential,none,
5798
+ " '%0' attribute cannot apply to non-protocol type %1" , (StringRef, Type))
5799
+
5795
5800
WARNING(unchecked_conformance_not_special,none,
5796
5801
" @unchecked conformance to %0 has no meaning" , (Type))
5797
5802
WARNING(restate_unchecked_sendable,none,
5798
5803
" class %0 must restate inherited '@unchecked Sendable' conformance" ,
5799
5804
(DeclName))
5800
- ERROR(unchecked_not_inheritance_clause,none,
5801
- " 'unchecked' attribute only applies in inheritance clauses" , ())
5802
- ERROR(unchecked_not_existential,none,
5803
- " 'unchecked' attribute cannot apply to non-protocol type %0" , (Type))
5804
5805
5805
5806
WARNING(preconcurrency_conformance_not_used,none,
5806
5807
" @preconcurrency attribute on conformance to %0 has no effect" , (Type))
5807
- ERROR(preconcurrency_not_inheritance_clause,none,
5808
- " 'preconcurrency' attribute only applies in inheritance clauses" , ())
5809
- ERROR(preconcurrency_not_existential,none,
5810
- " 'preconcurrency' attribute cannot apply to non-protocol type %0" , (Type))
5811
5808
5812
5809
ERROR(redundant_any_in_existential,none,
5813
5810
" redundant 'any' in type %0" ,
@@ -8084,22 +8081,33 @@ NOTE(note_reference_to_unsafe_decl,none,
8084
8081
NOTE(note_reference_to_unsafe_typed_decl,none,
8085
8082
" %select{reference|call}0 to %kind1 involves unsafe type %2" ,
8086
8083
(bool , const ValueDecl *, Type))
8084
+ NOTE(note_reference_to_unsafe_through_typealias,none,
8085
+ " reference to %kind0 whose underlying type involves unsafe type %1" ,
8086
+ (const ValueDecl *, Type))
8087
8087
NOTE(note_reference_to_nonisolated_unsafe,none,
8088
8088
" reference to nonisolated(unsafe) %kind0 is unsafe in concurrently-executing code" ,
8089
8089
(const ValueDecl *))
8090
8090
NOTE(note_reference_unowned_unsafe,none,
8091
8091
" reference to unowned(unsafe) %kind0 is unsafe" , (const ValueDecl *))
8092
-
8093
- GROUPED_WARNING(override_safe_withunsafe,Unsafe,none,
8094
- " override of safe %0 with unsafe %0" , (DescriptiveDeclKind))
8095
- GROUPED_WARNING(witness_unsafe,Unsafe,none,
8092
+ NOTE(note_use_of_unsafe_conformance_is_unsafe,none,
8093
+ " @unsafe conformance of %0 to %kind1 involves unsafe code" ,
8094
+ (Type, const ValueDecl *))
8095
+ GROUPED_WARNING(conformance_involves_unsafe,Unsafe,none,
8096
+ " conformance of %0 to %kind1 involves unsafe code; use '@unsafe' to "
8097
+ " indicate that the conformance is not memory-safe" ,
8098
+ (Type, const ValueDecl *))
8099
+ NOTE(note_witness_unsafe,none,
8096
8100
" unsafe %0 %1 cannot satisfy safe requirement" ,
8097
8101
(DescriptiveDeclKind, DeclName))
8098
- GROUPED_WARNING(type_witness_unsafe,Unsafe ,none,
8102
+ NOTE(note_type_witness_unsafe ,none,
8099
8103
" unsafe type %0 cannot satisfy safe associated type %1" ,
8100
8104
(Type, DeclName))
8101
- GROUPED_WARNING(unchecked_conformance_is_unsafe,Unsafe,none,
8102
- " @unchecked conformance involves unsafe code" , ())
8105
+
8106
+ GROUPED_WARNING(override_safe_withunsafe,Unsafe,none,
8107
+ " override of safe %0 with unsafe %0" , (DescriptiveDeclKind))
8108
+ GROUPED_WARNING(use_of_unsafe_conformance_is_unsafe,Unsafe,none,
8109
+ " @unsafe conformance of %0 to %kind1 involves unsafe code" ,
8110
+ (Type, const ValueDecl *))
8103
8111
GROUPED_WARNING(reference_unowned_unsafe,Unsafe,none,
8104
8112
" reference to unowned(unsafe) %kind0 is unsafe" , (const ValueDecl *))
8105
8113
GROUPED_WARNING(reference_to_nonisolated_unsafe,Unsafe,none,
@@ -8111,8 +8119,13 @@ GROUPED_WARNING(reference_to_unsafe_decl,Unsafe,none,
8111
8119
GROUPED_WARNING(reference_to_unsafe_typed_decl,Unsafe,none,
8112
8120
" %select{reference|call}0 to %kindbase1 involves unsafe type %2" ,
8113
8121
(bool , const ValueDecl *, Type))
8114
- NOTE(unsafe_decl_here,none,
8115
- " unsafe %kindbase0 declared here" , (const ValueDecl *))
8122
+ GROUPED_WARNING(reference_to_unsafe_through_typealias,Unsafe,none,
8123
+ " reference to %kind0 whose underlying type involves unsafe type %1" ,
8124
+ (const ValueDecl *, Type))
8125
+ GROUPED_WARNING(preconcurrency_import_unsafe,Unsafe,none,
8126
+ " @preconcurrency import is not memory-safe because it can silently "
8127
+ " introduce data races; use '@safe(unchecked)' to assert that the "
8128
+ " code is memory-safe" , ())
8116
8129
NOTE(encapsulate_unsafe_in_enclosing_context,none,
8117
8130
" make %kindbase0 @safe(unchecked) to allow it to use unsafe constructs in its definition" ,
8118
8131
(const Decl *))
0 commit comments