@@ -5792,22 +5792,19 @@ ERROR(non_sendable_type,none,
57925792ERROR(sendable_raw_storage,none,
57935793 " struct %0 with @_rawLayout does not conform to the 'Sendable' protocol" , (DeclName))
57945794
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+
57955800WARNING(unchecked_conformance_not_special,none,
57965801 " @unchecked conformance to %0 has no meaning" , (Type))
57975802WARNING(restate_unchecked_sendable,none,
57985803 " class %0 must restate inherited '@unchecked Sendable' conformance" ,
57995804 (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))
58045805
58055806WARNING(preconcurrency_conformance_not_used,none,
58065807 " @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))
58115808
58125809ERROR(redundant_any_in_existential,none,
58135810 " redundant 'any' in type %0" ,
@@ -8084,22 +8081,33 @@ NOTE(note_reference_to_unsafe_decl,none,
80848081NOTE(note_reference_to_unsafe_typed_decl,none,
80858082 " %select{reference|call}0 to %kind1 involves unsafe type %2" ,
80868083 (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))
80878087NOTE(note_reference_to_nonisolated_unsafe,none,
80888088 " reference to nonisolated(unsafe) %kind0 is unsafe in concurrently-executing code" ,
80898089 (const ValueDecl *))
80908090NOTE(note_reference_unowned_unsafe,none,
80918091 " 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,
80968100 " unsafe %0 %1 cannot satisfy safe requirement" ,
80978101 (DescriptiveDeclKind, DeclName))
8098- GROUPED_WARNING(type_witness_unsafe,Unsafe ,none,
8102+ NOTE(note_type_witness_unsafe ,none,
80998103 " unsafe type %0 cannot satisfy safe associated type %1" ,
81008104 (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 *))
81038111GROUPED_WARNING(reference_unowned_unsafe,Unsafe,none,
81048112 " reference to unowned(unsafe) %kind0 is unsafe" , (const ValueDecl *))
81058113GROUPED_WARNING(reference_to_nonisolated_unsafe,Unsafe,none,
@@ -8111,8 +8119,13 @@ GROUPED_WARNING(reference_to_unsafe_decl,Unsafe,none,
81118119GROUPED_WARNING(reference_to_unsafe_typed_decl,Unsafe,none,
81128120 " %select{reference|call}0 to %kindbase1 involves unsafe type %2" ,
81138121 (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" , ())
81168129NOTE(encapsulate_unsafe_in_enclosing_context,none,
81178130 " make %kindbase0 @safe(unchecked) to allow it to use unsafe constructs in its definition" ,
81188131 (const Decl *))
0 commit comments