@@ -4523,7 +4523,7 @@ WARNING(nan_comparison_both_nan, none,
45234523 (StringRef, bool ))
45244524
45254525// If you change this, also change enum TryKindForDiagnostics.
4526- #define TRY_KIND_SELECT (SUB ) " %select{try|try!|try?|await}" #SUB
4526+ #define TRY_KIND_SELECT (SUB ) " %select{try|try!|try?|await|unsafe }" #SUB
45274527
45284528ERROR (try_rhs,none,
45294529 " '" TRY_KIND_SELECT(0 ) "' cannot appear to the right of a "
@@ -8079,11 +8079,6 @@ NOTE(sending_function_result_with_sending_param_note, none,
80798079ERROR(unsafe_attr_disabled,none,
80808080 " attribute requires '-enable-experimental-feature AllowUnsafeAttribute'" , ())
80818081
8082- GROUPED_WARNING(decl_involves_unsafe,Unsafe,none,
8083- " %kindbase0 involves unsafe code; "
8084- " use %select{'@unsafe' to indicate that its use is not memory-safe|"
8085- " '@safe(unchecked)' to assert that the code is memory-safe}1" ,
8086- (const Decl *, bool ))
80878082NOTE(note_reference_to_unsafe_decl,none,
80888083 " %select{reference|call}0 to unsafe %kind1" ,
80898084 (bool , const ValueDecl *))
@@ -8103,6 +8098,12 @@ NOTE(note_reference_exclusivity_unchecked,none,
81038098NOTE(note_use_of_unsafe_conformance_is_unsafe,none,
81048099 " @unsafe conformance of %0 to %kind1 involves unsafe code" ,
81058100 (Type, const ValueDecl *))
8101+
8102+ GROUPED_WARNING(decl_signature_involves_unsafe,Unsafe,none,
8103+ " %kindbase0 has an interface that is not memory-safe; "
8104+ " use '@unsafe' to indicate that its use is unsafe" ,
8105+ (const Decl *))
8106+
81068107GROUPED_WARNING(conformance_involves_unsafe,Unsafe,none,
81078108 " conformance of %0 to %kind1 involves unsafe code; use '@unsafe' to "
81088109 " indicate that the conformance is not memory-safe" ,
@@ -8114,44 +8115,19 @@ NOTE(note_type_witness_unsafe,none,
81148115 " unsafe type %0 cannot satisfy safe associated type %1" ,
81158116 (Type, DeclName))
81168117
8117- GROUPED_WARNING(override_safe_withunsafe ,Unsafe,none,
8118+ GROUPED_WARNING(override_safe_with_unsafe ,Unsafe,none,
81188119 " override of safe %0 with unsafe %0" , (DescriptiveDeclKind))
8119- GROUPED_WARNING(use_of_unsafe_conformance_is_unsafe,Unsafe,none,
8120- " @unsafe conformance of %0 to %kind1 involves unsafe code" ,
8121- (Type, const ValueDecl *))
8122- GROUPED_WARNING(reference_unowned_unsafe,Unsafe,none,
8123- " reference to unowned(unsafe) %kind0 is unsafe" , (const ValueDecl *))
8124- GROUPED_WARNING(reference_exclusivity_unchecked,Unsafe,none,
8125- " reference to @exclusivity(unchecked) %kind0 is unsafe" , (const ValueDecl *))
8126-
8127- GROUPED_WARNING(reference_to_nonisolated_unsafe,Unsafe,none,
8128- " reference to nonisolated(unsafe) %kind0 is unsafe in concurrently-executing code" ,
8129- (const ValueDecl *))
8130- GROUPED_WARNING(reference_to_unsafe_decl,Unsafe,none,
8131- " %select{reference|call}0 to unsafe %kindbase1" ,
8132- (bool , const ValueDecl *))
8133- GROUPED_WARNING(reference_to_unsafe_typed_decl,Unsafe,none,
8134- " %select{reference|call}0 to %kindbase1 involves unsafe type %2" ,
8135- (bool , const ValueDecl *, Type))
8136- GROUPED_WARNING(reference_to_unsafe_through_typealias,Unsafe,none,
8137- " reference to %kind0 whose underlying type involves unsafe type %1" ,
8138- (const ValueDecl *, Type))
8120+
81398121GROUPED_WARNING(preconcurrency_import_unsafe,Unsafe,none,
81408122 " @preconcurrency import is not memory-safe because it can silently "
8141- " introduce data races; use '@safe(unchecked)' to assert that the "
8142- " code is memory-safe" , ())
8143- NOTE(encapsulate_unsafe_in_enclosing_context,none,
8144- " make %kindbase0 @safe(unchecked) to allow it to use unsafe constructs in its definition" ,
8145- (const Decl *))
8146- NOTE(make_enclosing_context_unsafe,none,
8147- " make %kindbase0 @unsafe to indicate that its use is not memory-safe" ,
8148- (const Decl *))
8123+ " introduce data races" , ())
8124+ GROUPED_WARNING(unsafe_without_unsafe,Unsafe,none,
8125+ " expression uses unsafe constructs but is not marked with 'unsafe'" , ())
8126+ WARNING(no_unsafe_in_unsafe,none,
8127+ " no unsafe operations occur within 'unsafe' expression" , ())
81498128NOTE(make_subclass_unsafe,none,
81508129 " make class %0 @unsafe to allow unsafe overrides of safe superclass methods" ,
81518130 (DeclName))
8152- NOTE(make_conforming_context_unsafe,none,
8153- " make the enclosing %0 @unsafe to allow unsafe conformance to protocol %1" ,
8154- (DescriptiveDeclKind, DeclName))
81558131
81568132// ===----------------------------------------------------------------------===//
81578133// MARK: Value Generics
0 commit comments