Skip to content

Commit bed667c

Browse files
authored
Merge pull request #28375 from owenv/remove-unused-diags
[Gardening] Remove unused diagnostic definitions
2 parents 4cd873a + f37c1db commit bed667c

File tree

6 files changed

+0
-71
lines changed

6 files changed

+0
-71
lines changed

include/swift/AST/DiagnosticsCommon.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,6 @@ ERROR(sdk_node_unrecognized_accessor_kind,none,
145145
ERROR(circular_reference, none,
146146
"circular reference", ())
147147

148-
ERROR(redundant_type_alias_define, none,
149-
"redundant type alias declaration", ())
150-
151148
NOTE(circular_reference_through, none,
152149
"through reference here", ())
153150

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,6 @@ NOTE(compiled_module_invalid,none,
320320
NOTE(compiled_module_invalid_reason,none,
321321
"unable to load compiled module '%0': %1",
322322
(StringRef, StringRef))
323-
ERROR(error_extracting_dependencies_from_cached_module,none,
324-
"error extracting dependencies from cached module '%0'",
325-
(StringRef))
326323
ERROR(unknown_forced_module_loading_mode,none,
327324
"unknown value for SWIFT_FORCE_MODULE_LOADING variable: '%0'",
328325
(StringRef))

include/swift/AST/DiagnosticsParse.def

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,6 @@ ERROR(sil_dbg_unknown_key,none,
591591
"unknown key '%0' in debug variable declaration", (StringRef))
592592
ERROR(sil_objc_with_tail_elements,none,
593593
"alloc_ref [objc] cannot have tail allocated elements", ())
594-
ERROR(found_unqualified_instruction_in_qualified_function,none,
595-
"found unqualified instruction in qualified function '%0'", (StringRef))
596594
ERROR(sil_expected_access_kind,none,
597595
"%0 instruction must have explicit access kind", (StringRef))
598596
ERROR(sil_expected_access_enforcement,none,
@@ -605,9 +603,6 @@ ERROR(sil_keypath_unknown_component_kind,none,
605603
ERROR(sil_keypath_computed_property_missing_part,none,
606604
"keypath %select{gettable|settable}0_property component needs an "
607605
"%select{id and getter|id, getter, and setter}0", (bool))
608-
ERROR(sil_keypath_external_missing_part,none,
609-
"keypath external component with indices needs an indices_equals and "
610-
"indices_hash function", ())
611606
ERROR(sil_keypath_no_root,none,
612607
"keypath must have a root component declared",())
613608
ERROR(sil_keypath_index_not_hashable,none,
@@ -684,8 +679,6 @@ ERROR(sil_witness_protocol_conformance_not_found,none,
684679
"sil protocol conformance not found", ())
685680

686681
// SIL Coverage Map
687-
ERROR(sil_coverage_func_not_found, none,
688-
"sil function not found %0", (Identifier))
689682
ERROR(sil_coverage_invalid_hash, none,
690683
"expected coverage hash", ())
691684
ERROR(sil_coverage_expected_lbrace, none,
@@ -1280,12 +1273,6 @@ ERROR(expr_selector_expected_rparen,PointsToFirstBadToken,
12801273
"expected ')' to complete '#selector' expression", ())
12811274

12821275
// Type-of expressions.
1283-
ERROR(expr_typeof_expected_label_of,PointsToFirstBadToken,
1284-
"expected argument label 'of:' within 'type(...)'", ())
1285-
ERROR(expr_typeof_expected_expr,PointsToFirstBadToken,
1286-
"expected an expression within 'type(of: ...)'", ())
1287-
ERROR(expr_typeof_expected_rparen,PointsToFirstBadToken,
1288-
"expected ')' to complete 'type(of: ...)' expression", ())
12891276
ERROR(expr_dynamictype_deprecated,PointsToFirstBadToken,
12901277
"'.dynamicType' is deprecated. Use 'type(of: ...)' instead", ())
12911278

@@ -1480,10 +1467,6 @@ WARNING(attr_warn_unused_result_removed,none,
14801467
ERROR(attr_warn_unused_result_expected_rparen,none,
14811468
"expected ')' after 'warn_unused_result' attribute", ())
14821469

1483-
// escaping
1484-
ERROR(attr_escaping_conflicts_noescape,none,
1485-
"@escaping conflicts with @noescape", ())
1486-
14871470
// _specialize
14881471
ERROR(attr_specialize_missing_colon,none,
14891472
"missing ':' after %0 in '_specialize' attribute", (StringRef))

include/swift/AST/DiagnosticsRefactoring.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ ERROR(invalid_default_location, none, "given location is not on a default statem
6464

6565
ERROR(no_parent_switch, none, "cannot find enclosing switch statement", ())
6666

67-
ERROR(no_subject_enum, none, "cannot find subject enum in the enclosing switch statement", ())
68-
6967
ERROR(no_remaining_cases, none, "no remaining cases to expand", ())
7068

7169
WARNING(mismatched_rename, none, "the name at the given location cannot be renamed to '%0'", (StringRef))

include/swift/AST/DiagnosticsSIL.def

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ ERROR(self_inside_catch_superselfinit,none,
222222
"'self' used inside 'catch' block reachable from "
223223
"%select{super|self}0.init call",
224224
(unsigned))
225-
ERROR(return_from_init_without_initing_self,none,
226-
"return from initializer before 'self.init' call or assignment to 'self'", ())
227225
ERROR(return_from_init_without_initing_stored_properties,none,
228226
"return from initializer without initializing all"
229227
" stored properties", ())
@@ -324,9 +322,6 @@ ERROR(integer_conversion_overflow_builtin_types,none,
324322
WARNING(integer_conversion_overflow_warn,none,
325323
"integer overflows when converted from %0 to %1",
326324
(Type, Type))
327-
ERROR(integer_conversion_sign_error,none,
328-
"negative integer cannot be converted to unsigned type %0",
329-
(Type))
330325
ERROR(negative_integer_literal_overflow_unsigned,none,
331326
"negative integer '%1' overflows when stored into unsigned type %0",
332327
(Type, StringRef))

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ ERROR(expected_result_in_contextual_member,none,
123123

124124
ERROR(unexpected_arguments_in_enum_case,none,
125125
"enum case %0 has no associated values", (DeclName))
126-
ERROR(unexpected_arguments_in_contextual_member,none,
127-
"%0 %1 is not a function", (DescriptiveDeclKind, DeclName))
128126

129127
ERROR(could_not_use_value_member,none,
130128
"member %1 cannot be used on value of type %0", (Type, DeclName))
@@ -261,9 +259,6 @@ ERROR(cannot_pass_rvalue_inout,none,
261259
ERROR(cannot_provide_default_value_inout,none,
262260
"cannot provide default value to inout parameter %0", (Identifier))
263261

264-
ERROR(cannot_assign_to_literal,none,
265-
"cannot assign to a literal value", ())
266-
267262
ERROR(cannot_call_with_no_params,none,
268263
"cannot invoke %select{|initializer for type }1'%0' with no arguments",
269264
(StringRef, bool))
@@ -440,8 +435,6 @@ NOTE(candidate_performs_illegal_ephemeral_conv,none,
440435

441436
ERROR(cannot_convert_argument_value_protocol,none,
442437
"argument type %0 does not conform to expected type %1", (Type, Type))
443-
ERROR(cannot_convert_partial_argument_value_protocol,none,
444-
"in argument type %0, %1 does not conform to expected type %2", (Type, Type, Type))
445438

446439
ERROR(cannot_convert_argument_value_nil,none,
447440
"'nil' is not compatible with expected argument type %0", (Type))
@@ -566,9 +559,6 @@ ERROR(cannot_convert_sequence_element_protocol,none,
566559
ERROR(throws_functiontype_mismatch,none,
567560
"invalid conversion from throwing function of type %0 to "
568561
"non-throwing function type %1", (Type, Type))
569-
ERROR(noescape_functiontype_mismatch,none,
570-
"invalid conversion from non-escaping function of type %0 to "
571-
"potentially escaping function type %1", (Type, Type))
572562

573563
// Key-path expressions.
574564
ERROR(expr_keypath_no_objc_runtime,none,
@@ -1162,9 +1152,6 @@ ERROR(instance_member_in_initializer,none,
11621152
ERROR(instance_member_in_default_parameter,none,
11631153
"cannot use instance member %0 as a default parameter", (DeclName))
11641154

1165-
ERROR(invalid_initialization_parameter_same_type,none,
1166-
"invalid initializer call with same type %0 as parameter", (Type))
1167-
11681155
ERROR(missing_argument_named,none,
11691156
"missing argument for parameter %0 in call", (Identifier))
11701157
ERROR(missing_argument_positional,none,
@@ -1397,8 +1384,6 @@ ERROR(access_control_open_bad_decl,none,
13971384
"only classes and overridable class members can be declared 'open';"
13981385
" use 'public'", ())
13991386

1400-
ERROR(invalid_decl_attribute_simple,none,
1401-
"attribute cannot be applied to declaration", ())
14021387
ERROR(invalid_decl_attribute,none,
14031388
"'%0' attribute cannot be applied to this declaration", (DeclAttribute))
14041389
ERROR(invalid_decl_modifier,none,
@@ -2230,9 +2215,6 @@ ERROR(recursive_same_type_constraint,none,
22302215
"same-type constraint %0 == %1 is recursive", (Type, Type))
22312216
ERROR(recursive_superclass_constraint,none,
22322217
"superclass constraint %0 : %1 is recursive", (Type, Type))
2233-
ERROR(requires_same_type_conflict,none,
2234-
"%select{associated type|generic parameter}0 %1 cannot be equal to "
2235-
"both %2 and %3", (bool, Type, Type, Type))
22362218
ERROR(requires_generic_param_same_type_does_not_conform,none,
22372219
"same-type constraint type %0 does not conform to required protocol %1",
22382220
(Type, Identifier))
@@ -2907,9 +2889,6 @@ NOTE(found_candidate_type,none,
29072889

29082890
ERROR(no_MaxBuiltinFloatType_found,none,
29092891
"standard library error: _MaxBuiltinFloatType is not properly defined", ())
2910-
ERROR(integer_literal_overflows_maxwidth, none,
2911-
"integer literal needs %1 bits, exceeding limit of %0 bits",
2912-
(unsigned, unsigned))
29132892

29142893
ERROR(no_member_of_module,none,
29152894
"module %0 has no member named %1", (Identifier, DeclName))
@@ -3080,8 +3059,6 @@ ERROR(missing_protocol,none,
30803059
"missing protocol %0", (Identifier))
30813060
ERROR(nil_literal_broken_proto,none,
30823061
"protocol 'ExpressibleByNilLiteral' is broken", ())
3083-
ERROR(array_protocol_broken,none,
3084-
"protocol 'ExpressibleByArrayLiteral' is broken", ())
30853062
ERROR(builtin_integer_literal_broken_proto,none,
30863063
"protocol '_ExpressibleByBuiltinIntegerLiteral' is broken", ())
30873064
ERROR(integer_literal_broken_proto,none,
@@ -3122,8 +3099,6 @@ ERROR(should_use_empty_dictionary_literal,none,
31223099
"use [:] to get an empty dictionary literal", ())
31233100

31243101
// Dictionary literals
3125-
ERROR(dictionary_protocol_broken,none,
3126-
"ExpressibleByDictionaryLiteral protocol definition is broken", ())
31273102
ERROR(type_is_not_dictionary,none,
31283103
"contextual type %0 cannot be used with dictionary literal", (Type))
31293104

@@ -3434,12 +3409,6 @@ ERROR(assignment_let_property_delegating_init,none,
34343409
"'let' property %0 may not be initialized directly; use "
34353410
"\"self.init(...)\" or \"self = ...\" instead", (DeclName))
34363411

3437-
// ForEach Stmt
3438-
ERROR(sequence_protocol_broken,none,
3439-
"SequenceType protocol definition is broken", ())
3440-
ERROR(iterator_protocol_broken,none,
3441-
"IteratorProtocol protocol definition is broken", ())
3442-
34433412
ERROR(label_shadowed, none,
34443413
"label %0 cannot be reused on an inner statement", (Identifier))
34453414
ERROR(break_outside_loop,none,
@@ -3573,9 +3542,6 @@ ERROR(closure_tuple_parameter_destructuring,none,
35733542
ERROR(closure_tuple_parameter_destructuring_implicit,none,
35743543
"closure tuple parameter %0 does not support destructuring "
35753544
"with implicit parameters", (Type))
3576-
ERROR(nested_tuple_parameter_destructuring,none,
3577-
"nested tuple parameter %0 of function %1 "
3578-
"does not support destructuring", (Type, Type))
35793545
ERROR(single_tuple_parameter_mismatch_special,none,
35803546
"%0 expects a single parameter of type %1%2",
35813547
(DescriptiveDeclKind, Type, StringRef))
@@ -4123,14 +4089,9 @@ ERROR(nonlocal_bridged_to_objc,none,
41234089
"conformance of %0 to %1 can only be written in module %2",
41244090
(Identifier, Identifier, Identifier))
41254091

4126-
ERROR(broken_bridged_to_objc_protocol,none,
4127-
"_BridgedToObjectiveC protocol is broken", ())
4128-
41294092
ERROR(missing_bridging_function,Fatal,
41304093
"missing '%select{_forceBridgeFromObjectiveC|"
41314094
"_conditionallyBridgeFromObjectiveC}0'", (bool))
4132-
ERROR(missing_nserror_bridging_function,none,
4133-
"missing _bridgeNSError", ())
41344095

41354096
#define OBJC_DIAG_SELECT "%select{initializer %1|implicit initializer %1|deinitializer|implicit deinitializer|method %1|getter for %1|subscript getter|setter for %1|subscript setter}0"
41364097

@@ -4489,8 +4450,6 @@ ERROR(specialize_attr_only_generic_param_req,none,
44894450
"Only requirements on generic parameters are supported by '_specialize' attribute", ())
44904451
ERROR(specialize_attr_only_one_concrete_same_type_req,none,
44914452
"Only one concrete type should be used in the same-type requirement in '_specialize' attribute", ())
4492-
ERROR(specialize_attr_non_nominal_type_constraint_req,none,
4493-
"Only conformances to nominal types are supported by '_specialize' attribute", ())
44944453
ERROR(specialize_attr_non_protocol_type_constraint_req,none,
44954454
"Only conformances to protocol types are supported by '_specialize' attribute", ())
44964455
ERROR(specialize_attr_type_parameter_count_mismatch,none,

0 commit comments

Comments
 (0)