From 8dad181aeb223e7801cfaa14760c6240a0df8a02 Mon Sep 17 00:00:00 2001 From: Ryan Mansfield Date: Tue, 16 Jul 2024 14:01:26 -0400 Subject: [PATCH] Remove unused diagnostics. --- .../swift/AST/DiagnosticsClangImporter.def | 1 - include/swift/AST/DiagnosticsCommon.def | 2 - include/swift/AST/DiagnosticsDriver.def | 32 ----- include/swift/AST/DiagnosticsFrontend.def | 13 -- include/swift/AST/DiagnosticsIRGen.def | 3 - include/swift/AST/DiagnosticsParse.def | 42 ------ include/swift/AST/DiagnosticsRefactoring.def | 4 - include/swift/AST/DiagnosticsSIL.def | 18 --- include/swift/AST/DiagnosticsSema.def | 126 ------------------ include/swift/AST/EducationalNotes.def | 1 - 10 files changed, 242 deletions(-) diff --git a/include/swift/AST/DiagnosticsClangImporter.def b/include/swift/AST/DiagnosticsClangImporter.def index 0bc2259a7c0dc..e1313e820c45d 100644 --- a/include/swift/AST/DiagnosticsClangImporter.def +++ b/include/swift/AST/DiagnosticsClangImporter.def @@ -146,7 +146,6 @@ NOTE(macro_not_imported_unsupported_named_operator, none, "operator '%0' not sup NOTE(macro_not_imported_invalid_string_literal, none, "invalid string literal", ()) NOTE(macro_not_imported_invalid_numeric_literal, none, "invalid numeric literal", ()) NOTE(macro_not_imported_unsupported_literal, none, "only numeric and string macro literals supported", ()) -NOTE(macro_not_imported_nested_cast, none, "non-null nested casts not supported", ()) NOTE(macro_not_imported_function_like, none, "macro '%0' unavailable: function like macros not supported", (StringRef)) NOTE(macro_not_imported_unsupported_structure, none, "macro '%0' unavailable: structure not supported", (StringRef)) diff --git a/include/swift/AST/DiagnosticsCommon.def b/include/swift/AST/DiagnosticsCommon.def index 476539a15697c..16917a465ec66 100644 --- a/include/swift/AST/DiagnosticsCommon.def +++ b/include/swift/AST/DiagnosticsCommon.def @@ -232,8 +232,6 @@ NOTE(in_macro_expansion,none, ERROR(macro_experimental,none, "%0 macros are an experimental feature that is not enabled %select{|(%1)}1", (StringRef, StringRef)) -ERROR(ambiguous_macro_reference,none, - "ambiguous reference to macro %0", (DeclName)) //------------------------------------------------------------------------------ // MARK: bridged diagnostics diff --git a/include/swift/AST/DiagnosticsDriver.def b/include/swift/AST/DiagnosticsDriver.def index 7874cfcbd7e5e..471d98010598a 100644 --- a/include/swift/AST/DiagnosticsDriver.def +++ b/include/swift/AST/DiagnosticsDriver.def @@ -80,15 +80,6 @@ ERROR(error_unsupported_option,none, "option '%0' is not supported by '%1'; did you mean to use '%2'?", (StringRef, StringRef, StringRef)) -WARNING(incremental_requires_output_file_map,none, - "ignoring -incremental (currently requires an output file map)", ()) -WARNING(incremental_requires_build_record_entry,none, - "ignoring -incremental; output file map has no master dependencies " - "entry (\"%0\" under \"\")", (StringRef)) - -WARNING(unable_to_open_incremental_comparison_log,none, -"unable to open incremental comparison log file '%0'", (StringRef)) - ERROR(error_os_minimum_deployment,none, "Swift requires a minimum deployment target of %0", (StringRef)) ERROR(error_sdk_too_old,none, @@ -100,22 +91,6 @@ ERROR(error_unsupported_target_variant,none, "unsupported '%select{-target|-target-variant}1' value '%0'; use 'ios-macabi' instead", (StringRef, bool)) -WARNING(warn_arclite_not_found_when_link_objc_runtime,none, - "unable to find Objective-C runtime support library 'arclite'; " - "pass '-no-link-objc-runtime' to silence this warning", ()) - -WARNING(warn_cannot_stat_input,none, - "unable to determine when '%0' was last modified: %1", - (StringRef, StringRef)) - -WARNING(warn_unable_to_load_dependencies, none, - "unable to load dependencies file \"%0\", disabling incremental mode", - (StringRef)) - -ERROR(error_input_changed_during_build,none, - "input file '%0' was modified during the build", - (StringRef)) - ERROR(error_conflicting_options, none, "conflicting options '%0' and '%1'", (StringRef, StringRef)) @@ -131,9 +106,6 @@ WARNING(warn_ignore_embed_bitcode_marker, none, WARNING(verify_debug_info_requires_debug_option,none, "ignoring '-verify-debug-info'; no debug info is being generated", ()) -ERROR(verify_incremental_dependencies_needs_incremental,none, - "'-verify-incremental-dependencies' requires '-incremental'", ()) - ERROR(error_profile_missing,none, "no profdata file exists at '%0'", (StringRef)) @@ -152,10 +124,6 @@ WARNING(warn_use_filelists_deprecated, none, "the option '-driver-use-filelists' is deprecated; use " "'-driver-filelist-threshold=0' instead", ()) -WARNING(warn_unable_to_load_primary, none, -"unable to load primary swift file \"%0\", %1", -(StringRef, StringRef)) - ERROR(cannot_find_migration_script, none, "missing migration script from path '%0'", (StringRef)) diff --git a/include/swift/AST/DiagnosticsFrontend.def b/include/swift/AST/DiagnosticsFrontend.def index a2cd68088a091..361bd1cddbaf7 100644 --- a/include/swift/AST/DiagnosticsFrontend.def +++ b/include/swift/AST/DiagnosticsFrontend.def @@ -64,9 +64,6 @@ WARNING(warning_inferred_simulator_target,none, ERROR(error_argument_not_allowed_with, none, "argument '%0' is not allowed with '%1'", (StringRef, StringRef)) -WARNING(warning_argument_not_supported_with_optimization, none, - "argument '%0' is not supported with optimization", (StringRef)) - ERROR(error_option_requires_sanitizer, none, "option '%0' requires a sanitizer to be enabled. Use -sanitize= to " "enable a sanitizer", (StringRef)) @@ -107,8 +104,6 @@ WARNING(warning_cannot_multithread_batch_mode,none, "ignoring -num-threads argument; cannot multithread batch mode", ()) ERROR(error_cannot_explicit_interface_build_in_mode,none, "'-explicit-interface-module-build' only supported when building a module from interface ('-compile-module-from-interface' or '-typecheck-module-from-interface')'", ()) -ERROR(error_cannot_direct_cc1_pcm_build_in_mode,none, - "'-direct-clang-cc1-module-build' only supported when building a PCM ('-emit-pcm')'", ()) ERROR(error_unsupported_option_argument,none, "unsupported argument '%1' to option '%0'", (StringRef, StringRef)) ERROR(error_swift_module_file_requires_delimeter,none, @@ -122,8 +117,6 @@ ERROR(error_immediate_mode_primary_file,none, "immediate mode is incompatible with -primary-file", ()) ERROR(error_missing_frontend_action,none, "no frontend action was selected", ()) -ERROR(error_unsupported_frontend_action, none, - "unsupported action: %0", (StringRef)) ERROR(error_invalid_source_location_str,none, "invalid source location string '%0'", (StringRef)) ERROR(error_no_source_location_scope_map,none, @@ -258,10 +251,6 @@ ERROR(error_cannot_have_supplementary_outputs,none, ERROR(error_duplicate_input_file,none, "duplicate input file '%0'", (StringRef)) -ERROR(repl_must_be_initialized,none, - "variables currently must have an initial value when entered at the " - "top level of the REPL", ()) - ERROR(verify_encountered_fatal,none, "fatal error encountered while in -verify mode", ()) @@ -431,8 +420,6 @@ ERROR(unsupported_version_of_module_interface,none, (StringRef, llvm::VersionTuple)) ERROR(error_opening_explicit_module_file,none, "failed to open explicit Swift module: %0", (StringRef)) -ERROR(error_extracting_flags_from_module_interface,none, - "error extracting flags from module interface", ()) WARNING(warning_module_shadowing_may_break_module_interface,none, "public %0 %1 shadows module %2, which may cause failures when " "importing %3 or its clients in some configurations; please rename " diff --git a/include/swift/AST/DiagnosticsIRGen.def b/include/swift/AST/DiagnosticsIRGen.def index 93622343ff5b8..feb4df9f21ec0 100644 --- a/include/swift/AST/DiagnosticsIRGen.def +++ b/include/swift/AST/DiagnosticsIRGen.def @@ -50,9 +50,6 @@ ERROR(alignment_more_than_maximum,none, "@_alignment cannot increase alignment above maximum alignment of %0", (unsigned)) -ERROR(raw_layout_dynamic_type_layout_unsupported,none, - "@_rawLayout is not yet supported for layouts dependent on generic types", ()) - ERROR(temporary_allocation_size_negative,none, "allocation capacity must be greater than or equal to zero", ()) ERROR(temporary_allocation_size_overflow,none, diff --git a/include/swift/AST/DiagnosticsParse.def b/include/swift/AST/DiagnosticsParse.def index 9a36b7f4b1c97..7d1d8b95b2160 100644 --- a/include/swift/AST/DiagnosticsParse.def +++ b/include/swift/AST/DiagnosticsParse.def @@ -311,9 +311,6 @@ ERROR(observing_accessor_in_subscript,none, ERROR(getset_cannot_be_implied,none, "variable with implied type cannot have implied getter/setter", ()) -ERROR(init_accessor_expected_name,none, - "expected property name in init accessor effect", ()) - // Import ERROR(decl_expected_module_name,none, "expected module name in import declaration", ()) @@ -673,8 +670,6 @@ ERROR(sil_keypath_index_operand_type_conflict,none, ERROR(sil_keypath_no_use_of_operand_in_pattern,none, "operand %0 is not referenced by any component in the pattern", (unsigned)) -ERROR(sil_movevalue_invalid_optional_attribute,none, - "Optional attribute '[%0]' can not be applied to move_value", (StringRef)) ERROR(sil_markmustcheck_invalid_attribute,none, "Attribute '[%0]' can not be applied to mark_value_as_moveonly", (StringRef)) ERROR(sil_markmustcheck_requires_attribute,none, @@ -736,8 +731,6 @@ ERROR(sil_vtable_expect_rsquare,none, "expected ']' after vtable entry kind", ()) // SIL MoveOnlyDeinit -ERROR(expected_sil_moveonlydeinit_colon,none, - "expected ':' in a MoveOnlyDeinit entry", ()) ERROR(sil_moveonlydeinit_func_not_found,none, "sil function not found %0", (Identifier)) ERROR(sil_moveonlydeinit_nominal_not_found,none, @@ -1364,10 +1357,6 @@ ERROR(expected_rsquare_array_expr,PointsToFirstBadToken, ERROR(expected_arg_list_in_object_literal,PointsToFirstBadToken, "expected argument list in object literal", ()) -// Unknown pound expression. -ERROR(unknown_pound_expr,none, - "use of unknown directive '#%0'", (StringRef)) - // Ternary expressions ERROR(expected_expr_after_ternary_question,none, "expected expression after '?' in ternary expression", ()) @@ -1375,8 +1364,6 @@ ERROR(expected_colon_after_ternary_question,none, "expected ':' after '? ...' in ternary expression", ()) ERROR(expected_expr_after_ternary_colon,none, "expected expression after '? ... :' in ternary expression", ()) -ERROR(expected_expr_after_try, none, - "expected expression after 'try'", ()) ERROR(expected_expr_after_await, none, "expected expression after 'await'", ()) ERROR(expected_expr_after_move, none, @@ -1492,9 +1479,6 @@ WARNING(warning_in_effects_attribute,none, ERROR(expected_in_attribute_list,none, "expected ']' or ',' in attribute list", ()) -ERROR(expected_depends_on,none, - "expected 'depends_on'", ()) - ERROR(type_attribute_applied_to_decl,none, "attribute can only be applied to types, not declarations", ()) ERROR(decl_attribute_applied_to_type,none, @@ -1522,9 +1506,6 @@ ERROR(attr_expected_comma,none, ERROR(attr_expected_string_literal,none, "expected string literal in '%0' attribute", (StringRef)) -ERROR(attr_expected_integer_literal,none, -"expected integer literal in '%0' attribute", (StringRef)) - ERROR(attr_expected_option_such_as,none, "expected '%0' option such as '%1'", (StringRef, StringRef)) @@ -1782,8 +1763,6 @@ ERROR(attr_differentiable_kind_not_supported,PointsToFirstBadToken, "unsupported differentiability kind '%0'; only 'reverse' is supported", (StringRef)) ERROR(attr_differentiable_unknown_kind,PointsToFirstBadToken, "unknown differentiability kind '%0'; only 'reverse' is supported", (StringRef)) -ERROR(attr_differentiable_expected_parameter_list,PointsToFirstBadToken, - "expected a list of parameters to differentiate with respect to", ()) ERROR(attr_differentiable_use_wrt_not_withrespectto,none, "use 'wrt:' to specify parameters to differentiate with respect to", ()) ERROR(attr_differentiable_expected_label,none, @@ -1833,10 +1812,6 @@ ERROR(sil_inst_autodiff_expected_function_type_operand,PointsToFirstBadToken, ERROR(sil_inst_autodiff_expected_differentiability_witness_kind,PointsToFirstBadToken, "expected a differentiability witness kind, which can be one of '[jvp]', " "'[vjp]', or '[transpose]'", ()) -ERROR(sil_inst_autodiff_invalid_witness_generic_signature,PointsToFirstBadToken, - "expected witness_generic signature '%0' does not have same generic " - "parameters as original function generic signature '%1'", - (StringRef, StringRef)) WARNING(warn_attr_unsafe_removed,none, "'%0' attribute has been removed in favor of @preconcurrency", @@ -2069,23 +2044,6 @@ ERROR(associatedtype_cannot_be_variadic,none, ERROR(type_parameter_pack_ellipsis,none, "ellipsis operator cannot be used with a type parameter pack", ()) -//------------------------------------------------------------------------------ -// MARK: syntax parsing diagnostics -//------------------------------------------------------------------------------ -ERROR(unknown_syntax_entity, PointsToFirstBadToken, - "unknown %0 syntax exists in the source", (StringRef)) - -//------------------------------------------------------------------------------ -// MARK: multiple trailing closures diagnostics -//------------------------------------------------------------------------------ -ERROR(expected_argument_label_followed_by_closure_literal,none, - "expected an argument label followed by a closure literal", ()) -ERROR(expected_closure_literal,none, - "expected a closure literal", ()) - -ERROR(expected_multiple_closures_block_rbrace,none, - "expected '}' at the end of a trailing closures block", ()) - //------------------------------------------------------------------------------ // MARK: macros //------------------------------------------------------------------------------ diff --git a/include/swift/AST/DiagnosticsRefactoring.def b/include/swift/AST/DiagnosticsRefactoring.def index 7af78eafe7b42..c106bc9ce7287 100644 --- a/include/swift/AST/DiagnosticsRefactoring.def +++ b/include/swift/AST/DiagnosticsRefactoring.def @@ -28,16 +28,12 @@ ERROR(invalid_name, none, "'%0' is not a valid name", (StringRef)) ERROR(extract_function_not_supported_swiftsyntax_missing, none, "Extract Function is not supported because sourcekitd was built without swift-syntax", ()) -ERROR(invalid_location, none, "given location is not valid", ()) - ERROR(arity_mismatch, none, "the given new name '%0' does not match the arity of the old name '%1'", (StringRef, StringRef)) ERROR(name_not_functionlike, none, "the 'call' name usage cannot be used with a non-function-like name '%0'", (StringRef)) ERROR(unresolved_location, none, "cannot rename due to unresolved location", ()) -ERROR(location_module_mismatch, none, "given location does not belong to module '%0'", (StringRef)) - ERROR(value_decl_no_loc, none, "cannot rename %0 as it has no declaration location", (DeclName)) ERROR(decl_is_system_symbol, none, "cannot rename system symbol %0", (DeclName)) diff --git a/include/swift/AST/DiagnosticsSIL.def b/include/swift/AST/DiagnosticsSIL.def index f79546f05a2c4..6b42275a56215 100644 --- a/include/swift/AST/DiagnosticsSIL.def +++ b/include/swift/AST/DiagnosticsSIL.def @@ -615,10 +615,6 @@ NOTE(autodiff_member_subset_indices_not_differentiable,none, NOTE(autodiff_cannot_param_subset_thunk_partially_applied_orig_fn,none, "cannot convert a direct method reference to a '@differentiable' " "function; use an explicit closure instead", ()) -NOTE(autodiff_cannot_differentiate_through_multiple_results,none, - "cannot differentiate through multiple results", ()) -NOTE(autodiff_cannot_differentiate_through_inout_arguments,none, - "cannot differentiate through 'inout' arguments", ()) NOTE(autodiff_cannot_differentiate_through_direct_yield,none, "cannot differentiate through a '_read' accessor", ()) NOTE(autodiff_enums_unsupported,none, @@ -796,14 +792,6 @@ NOTE(capturepromotion_concurrentcapture_capturinguse_here, none, NOTE(capturepromotion_variable_defined_here,none, "variable defined here", ()) -// move operator used on generic or evalue -ERROR(move_operator_used_on_generic_or_existential_value, none, - "move() used on a generic or existential value", ()) - -// copy operator used on generic or evalue -ERROR(copy_operator_used_on_generic_or_existential_value, none, - "copy() used on a generic or existential value", ()) - // noimplicitcopy on generic or existential binding ERROR(noimplicitcopy_used_on_generic_or_existential, none, "@_noImplicitCopy can not be used on a generic or existential typed " @@ -976,12 +964,6 @@ ERROR(regionbasedisolation_arg_transferred, none, ERROR(regionbasedisolation_arg_passed_to_strongly_transferred_param, none, "%0 value of type %1 passed as a strongly transferred parameter; later accesses could race", (StringRef, Type)) -NOTE(regionbasedisolation_isolated_since_in_same_region_basename, none, - "value is %0 since it is in the same region as %1", - (StringRef, DeclBaseName)) -NOTE(regionbasedisolation_isolated_since_in_same_region_string, none, - "%0 is %1since it is in the same region as %2", - (Identifier, StringRef, Identifier)) //===--- // New Transfer Non Sendable Diagnostics diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index cc5e50301bec6..32578ed5c026a 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -313,10 +313,6 @@ ERROR(unsupported_closure_attr,none, "%select{attribute |}0 '%1' is not supported on a closure", (bool, StringRef)) -NOTE(suggest_expected_match,none, - "%select{expected an argument list|produces result}0 of type '%1'", - (bool, StringRef)) - NOTE(suggest_partial_overloads,none, "overloads for '%1' exist with these %select{" "partially matching parameter lists|result types}0: %2", @@ -1458,12 +1454,6 @@ NOTE(optional_base_remove_optional_for_keypath_root, none, "use unwrapped type %0 as key path root", (Type)) NOTE(optional_keypath_application_base, none, "use '?' to access key path subscript only for non-'nil' base values", ()) -NOTE(optional_key_path_root_base_chain, none, - "chain the optional using '?.' to access unwrapped type member %0", - (DeclNameRef)) -NOTE(optional_key_path_root_base_unwrap, none, - "unwrap the optional using '!.' to access unwrapped type member %0", - (DeclNameRef)) ERROR(optional_self_not_unwrapped,none, "explicit use of 'self' is required when 'self' is optional, " @@ -1610,9 +1600,6 @@ NOTE(candidate_with_extraneous_args,none, ERROR(no_accessible_initializers,none, "%0 cannot be constructed because it has no accessible initializers", (Type)) -ERROR(non_nominal_no_initializers,none, - "non-nominal type %0 does not support explicit initialization", - (Type)) ERROR(unbound_generic_parameter,none, "generic parameter %0 could not be inferred", (Type)) ERROR(unbound_generic_parameter_cast,none, @@ -1965,10 +1952,6 @@ ERROR(cdecl_throws,none, // @_used and @_section ERROR(section_linkage_markers_disabled,none, "attribute requires '-enable-experimental-feature SymbolLinkageMarkers'", ()) -ERROR(used_not_at_top_level,none, - "@_used can only be applied to global functions and variables", ()) -ERROR(section_not_at_top_level,none, - "@_section can only be applied to global functions and variables", ()) ERROR(section_empty_name,none, "@_section section name cannot be empty", ()) @@ -2468,13 +2451,6 @@ ERROR(function_type_access,none, "%select{a private|a fileprivate|an internal|a package|an '@_spi'|an '@_spi'}3" "%select{| API wrapper}6 type", (bool, AccessLevel, bool, AccessLevel, unsigned, unsigned, bool)) -ERROR(function_type_spi,none, - "%select{function|method|initializer}0 " - "cannot be declared '@_spi' " - "because its %select{parameter|result}1 uses " - "%select{a private|a fileprivate|an internal|a package|a public|an open}2 type" - "%select{| that is not '@_spi'}3", - (unsigned, bool, AccessLevel, bool)) WARNING(function_type_access_warn,none, "%select{function|method|initializer}4 " "%select{should be declared %select{private|fileprivate|internal|package|%error|%error}1" @@ -3065,10 +3041,6 @@ NOTE(protocol_witness_type_conflict,none, NOTE(protocol_witness_missing_requirement,none, "candidate would match if %0 %select{conformed to|subclassed|" "was the same type as|%error|%error}2 %1", (Type, Type, unsigned)) -NOTE(protocol_type_witness_missing_requirement,none, - "candidate would match if the conformance required that %0 " - "%select{conformed to|subclassed|was the same type as|%error|%error}2 %1", - (Type, Type, unsigned)) NOTE(protocol_witness_optionality_conflict,none, "candidate %select{type has|result type has|parameter type has|" @@ -3284,12 +3256,6 @@ WARNING(missing_protocol_refinement, none, ERROR(requirement_conflict,none, "no type for %0 can satisfy both %1", (Type, StringRef)) -ERROR(conflicting_superclass_constraints,none, - "type %0 cannot be a subclass of both %1 and %2", - (Type, Type, Type)) - -WARNING(redundant_same_type_constraint,none, - "redundant same-type constraint %0 == %1", (Type, Type)) WARNING(inherited_associated_type_redecl,none, "redeclaration of associated type %0 from protocol %1 is better " @@ -4169,8 +4135,6 @@ ERROR(implements_attr_protocol_not_conformed_to,none, (const NominalTypeDecl *, const ProtocolDecl *)) // @differentiable -ERROR(differentiable_attr_overload_not_found,none, - "%0 does not have expected type %1", (DeclNameRef, Type)) // TODO(TF-482): Change duplicate `@differentiable` attribute diagnostic to also // mention "same generic requirements". ERROR(differentiable_attr_duplicate,none, @@ -4214,9 +4178,6 @@ ERROR(derivative_attr_invalid_result_tuple_func_label,none, "'@derivative(of:)' attribute requires function to return a two-element " "tuple; second element must have label 'pullback:' or 'differential:'", ()) -ERROR(derivative_attr_result_value_not_differentiable,none, - "'@derivative(of:)' attribute requires function to return a two-element " - "tuple; first element type %0 must conform to 'Differentiable'", (Type)) ERROR(derivative_attr_result_func_type_mismatch,none, "function result's %0 type does not match %1", (Identifier, const ValueDecl *)) @@ -4224,8 +4185,6 @@ NOTE(derivative_attr_result_func_type_mismatch_note,none, "%0 does not have expected type %1", (Identifier, Type)) NOTE(derivative_attr_result_func_original_note,none, "%0 defined here", (const ValueDecl *)) -ERROR(derivative_attr_not_in_same_file_as_original,none, - "derivative not in the same file as the original function", ()) ERROR(derivative_attr_original_stored_property_unsupported,none, "cannot register derivative for stored property %0", (DeclNameRef)) ERROR(derivative_attr_class_member_dynamic_self_result_unsupported,none, @@ -4344,8 +4303,6 @@ ERROR(diff_params_clause_no_inferred_parameters,PointsToFirstBadToken, "no differentiation parameters could be inferred; must differentiate " "with respect to at least one parameter conforming to 'Differentiable'", ()) -ERROR(diff_params_clause_cannot_diff_wrt_inout_parameter,none, - "cannot differentiate with respect to 'inout' parameter (%0)", (Type)) ERROR(diff_params_clause_param_not_differentiable,none, "can only differentiate with respect to parameters that conform to " "'Differentiable', but %0 does not conform to 'Differentiable'", (Type)) @@ -4631,8 +4588,6 @@ ERROR(should_use_empty_dictionary_literal,none, "use [:] to get an empty dictionary literal", ()) // Dictionary literals -ERROR(type_is_not_dictionary,none, - "contextual type %0 cannot be used with dictionary literal", (Type)) WARNING(duplicated_literal_keys_in_dictionary_literal, none, "dictionary literal of type %0 has duplicate entries for %1 literal key%select{ %3|}2", (Type, StringRef, bool, StringRef)) @@ -5065,8 +5020,6 @@ ERROR(foreach_sequence_does_not_conform_to_expected_protocol,none, (Type, Type, bool)) // Switch Stmt -ERROR(no_match_operator,none, - "no binary '~=' operator available for 'switch' statement", ()) ERROR(fallthrough_outside_switch,none, "'fallthrough' is only allowed inside a switch", ()) ERROR(fallthrough_from_last_case,none, @@ -5095,9 +5048,6 @@ ERROR(unknown_case_multiple_patterns,none, ERROR(unknown_case_must_be_last,none, "'@unknown' can only be applied to the last case in a switch", ()) -ERROR(move_only_pattern_match_not_consumed,none, - "noncopyable binding being pattern-matched must have the 'consume' operator applied", ()) - WARNING(where_on_one_item, none, "'where' only applies to the second pattern match in this case", ()) @@ -5236,8 +5186,6 @@ ERROR(optional_element_pattern_not_valid_type,none, ERROR(condition_optional_element_pattern_not_valid_type,none, "initializer for conditional binding must have Optional type, not %0", (Type)) -ERROR(enum_element_pattern_not_member_of_enum,none, - "enum case %0 is not a member of type %1", (DeclNameRef, Type)) ERROR(ambiguous_enum_pattern_type,none, "generic enum type %0 is ambiguous without explicit generic parameters " "when matching value of type %1", (Type, Type)) @@ -5514,8 +5462,6 @@ ERROR(distributed_decl_needs_explicit_distributed_import,none, (const ValueDecl *)) NOTE(distributed_func_cannot_overload_on_async_only,none, "%0 previously declared here, cannot overload distributed methods on effect only", (const ValueDecl *)) -NOTE(distributed_func_other_ambiguous_overload_here,none, - "ambiguous distributed func %0 declared here", (DeclName)) ERROR(actor_isolated_inout_state,none, "actor-isolated %kind0 cannot be passed 'inout' to" "%select{| implicitly}1 'async' function call", @@ -5602,9 +5548,6 @@ ERROR(distributed_actor_target_result_not_codable,none, ERROR(distributed_actor_system_serialization_req_must_be_protocol,none, "'SerializationRequirement' type witness %0 must be a protocol type", (Type)) -ERROR(distributed_actor_remote_func_implemented_manually,none, - "distributed instance method's %0 remote counterpart %1 cannot not be implemented manually.", - (Identifier, Identifier)) ERROR(nonisolated_distributed_actor_storage,none, "'nonisolated' can not be applied to distributed actor stored properties", ()) @@ -5617,21 +5560,9 @@ ERROR(distributed_actor_func_inout, none, ERROR(distributed_actor_func_unsupported_specifier, none, "cannot declare '%0' argument %1 in %kind2", (StringRef, DeclName, const ValueDecl *)) -ERROR(distributed_actor_func_closure, none, - "%kind0 cannot declare closure arguments, as they cannot be serialized", - (const ValueDecl *)) ERROR(distributed_actor_func_variadic, none, "cannot declare variadic argument %0 in %kind1", (DeclName, const ValueDecl *)) -ERROR(distributed_actor_remote_func_is_not_static,none, - "remote function %0 must be static", - (DeclName)) -ERROR(distributed_actor_remote_func_is_not_async_throws,none, - "remote function %0 must be 'async throws'.", - (DeclName)) -ERROR(distributed_actor_remote_func_must_not_be_distributed,none, - "remote function %0 must be 'async throws'.", - (DeclName)) NOTE(actor_mutable_state,none, "mutation of this %0 is only permitted within the actor", (DescriptiveDeclKind)) @@ -5789,10 +5720,6 @@ ERROR(existential_requires_any,none, ERROR(inverse_requires_any,none, "constraint that suppresses conformance requires 'any'", ()) -ERROR(nonisolated_let,none, - "'nonisolated' is meaningless on 'let' declarations because " - "they are immutable", - ()) ERROR(nonisolated_mutable_storage,none, "'nonisolated' cannot be applied to mutable stored properties", ()) @@ -5835,26 +5762,13 @@ ERROR(actor_instance_property_wrapper,none, "the actor instance; consider 'nonisolated'", (Identifier, Identifier)) -ERROR(distributed_actor_func_defined_outside_of_distributed_actor,none, - "distributed instance method %0 is declared outside of an distributed actor", - (DeclName)) -ERROR(distributed_actor_local_var,none, - "'distributed' can not be applied to local variables", - ()) ERROR(distributed_actor_property,none, "'distributed' can not be applied to local properties", ()) -ERROR(distributed_actor_storage,none, - "'distributed' can not be applied to actor properties; " - "Only functions can be 'distributed'", - ()) ERROR(distributed_actor_not_actor,none, "'distributed' can only be applied to 'actor' definitions, " "and distributed actor-isolated async functions", ()) -ERROR(distributed_actor_not_actor_func,none, - "'distributed' can only be applied to distributed actor async functions", - ()) ERROR(distributed_actor_func_static,none, "'distributed' method cannot be 'static'", ()) @@ -5874,9 +5788,6 @@ ERROR(distributed_property_cannot_be_static,none, ERROR(distributed_property_can_only_be_computed,none, "%kind0 cannot be 'distributed', only computed properties can", (const ValueDecl *)) -ERROR(distributed_property_accessor_only_get_can_be_distributed,none, - "only 'get' accessors may be 'distributed'", - ()) NOTE(distributed_actor_isolated_property,none, "access to %kind0 is only permitted within distributed actor %1", (const ValueDecl *, DeclName)) @@ -6589,8 +6500,6 @@ ERROR(dynamic_with_transparent,none, // MARK: @_dynamicReplacement(for:) //------------------------------------------------------------------------------ -ERROR(dynamic_replacement_accessor_type_mismatch, none, - "replaced accessor %0's type does not match", (DeclName)) ERROR(dynamic_replacement_accessor_not_dynamic, none, "replaced accessor for %0 is not marked dynamic", (DeclName)) ERROR(dynamic_replacement_accessor_not_explicit, none, @@ -6716,10 +6625,6 @@ NOTE(availability_decl_more_than_enclosing_here, none, "enclosing scope requires availability of %0 %1 or newer", (StringRef, llvm::VersionTuple)) -NOTE(availability_decl_more_than_unavailable_enclosing_here, none, - "enclosing scope has been explicitly marked unavailable here", - ()) - ERROR(availability_decl_only_version_newer, none, "%0 is only available in %1 %2 or newer", (const ValueDecl *, StringRef, llvm::VersionTuple)) @@ -6956,13 +6861,6 @@ ERROR(inlinable_decl_ref_from_hidden_module, "%2 was not imported publicly}3", (const ValueDecl *, unsigned, Identifier, unsigned)) -WARNING(inlinable_decl_ref_from_hidden_module_warn, - none, "%kind0 cannot be used in " FRAGILE_FUNC_KIND "1 " - "because %select{<>|<>|<>|<>|" - "%2 was not imported by this file}3" - "; this is an error in the Swift 6 language mode", - (const ValueDecl *, unsigned, Identifier, unsigned)) - ERROR(inlinable_typealias_desugars_to_type_from_hidden_module, none, "%0 aliases '%1.%2' and cannot be used in " FRAGILE_FUNC_KIND "3 " "because %select{%4 has been imported as implementation-only|" @@ -7252,10 +7150,6 @@ ERROR(property_with_wrapper_overrides,none, "property %0 with attached wrapper cannot override another property", (Identifier)) -NOTE(property_wrapper_direct_init,none, - "initialize the property wrapper type directly with " - "'(...)' on the attribute", ()) - ERROR(property_wrapper_incompatible_property, none, "property type %0 does not match that of the 'wrappedValue' property of " "its wrapper type %1", (Type, Type)) @@ -7525,11 +7419,6 @@ ERROR(cannot_default_generic_parameter_inferrable_from_another_parameter, none, "is inferrable from parameters %1", (Type, StringRef)) -ERROR(cannot_default_generic_parameter_inferrable_through_same_type, none, - "cannot use default expression for inference of %0 because it " - "is inferrable through same-type requirement: '%1'", - (Type, StringRef)) - ERROR(cannot_default_generic_parameter_invalid_requirement, none, "cannot use default expression for inference of %0 because " "requirement '%1' refers to other generic parameters", @@ -7614,12 +7503,6 @@ ERROR(macro_must_be_defined,none, "macro %0 requires a definition", (DeclName)) ERROR(external_macro_outside_macro_definition,none, "macro 'externalMacro' can only be used to define another macro", ()) -NOTE(macro_note, none, - "%1 (in macro %0)", (DeclName, StringRef)) -WARNING(macro_warning, none, - "%1 (in macro %0)", (DeclName, StringRef)) -ERROR(macro_error, none, - "%1 (in macro %0)", (DeclName, StringRef)) ERROR(macro_type_access,none, "macro %select{must be declared " "%select{private|fileprivate|internal|package|%error|%error}1" @@ -7652,14 +7535,10 @@ ERROR(macro_multiple_freestanding_roles,none, "macro can only have a single freestanding role", ()) ERROR(macro_expansion_missing_pound,none, "expansion of macro %0 requires leading '#'", (DeclName)) -ERROR(macro_expansion_missing_arguments,none, - "expansion of macro %0 requires arguments", (DeclName)) ERROR(macro_unsupported,none, "macros are not supported in this compiler", ()) ERROR(macro_recursive,none, "recursive expansion of macro %0", (DeclName)) -ERROR(macro_definition_unsupported,none, - "macro definitions other than '#externalMacro(...)' are unsupported", ()) ERROR(external_macro_arg_not_type_name,none, "argument to `#externalMacro` must be a string literal naming " "the external macro's %select{module|type}0", (unsigned)) @@ -7783,9 +7662,6 @@ NOTE(note_inverse_preventing_conformance,none, NOTE(note_inverse_preventing_conformance_explicit,none, "%kind0 has '~%1' constraint preventing '%1' conformance", (const ValueDecl *, StringRef)) -NOTE(add_explicit_protocol_for_conformance,none, - "consider making %kind0 explicitly conform to the '%1' protocol", - (const ValueDecl *, StringRef)) ERROR(escapable_requires_feature_flag,none, "type 'Escapable' requires -enable-experimental-feature NonescapableTypes", ()) @@ -7897,8 +7773,6 @@ ERROR(experimental_moveonly_feature_can_only_be_used_when_enabled, "the usage of this language feature", ()) ERROR(noimplicitcopy_attr_valid_only_on_local_let_params, none, "'@_noImplicitCopy' attribute can only be applied to local lets and params", ()) -ERROR(noimplicitcopy_attr_invalid_in_generic_context, - none, "'@_noImplicitCopy' attribute cannot be applied to entities in generic contexts", ()) ERROR(noimplicitcopy_attr_not_allowed_on_moveonlytype,none, "'@_noImplicitCopy' has no effect when applied to a noncopyable type", ()) ERROR(noncopyable_types_cannot_be_resilient, none, diff --git a/include/swift/AST/EducationalNotes.def b/include/swift/AST/EducationalNotes.def index 6190c11f4a842..10b73799e03a4 100644 --- a/include/swift/AST/EducationalNotes.def +++ b/include/swift/AST/EducationalNotes.def @@ -29,7 +29,6 @@ EDUCATIONAL_NOTES(cannot_use_inout_non_ephemeral, "temporary-pointers.md") EDUCATIONAL_NOTES(cannot_construct_dangling_pointer, "temporary-pointers.md") -EDUCATIONAL_NOTES(non_nominal_no_initializers, "nominal-types.md") EDUCATIONAL_NOTES(non_nominal_extension, "nominal-types.md") EDUCATIONAL_NOTES(associated_type_witness_conform_impossible, "nominal-types.md")