Skip to content

Conversation

@jamieQ
Copy link
Contributor

@jamieQ jamieQ commented Nov 3, 2025

did a pass through the diagnostics to identify potentially-unused ones. criteria for inclusion was roughly:

  1. The diagnostic was added over 1 year ago but is no longer referenced
  2. The diagnostic didn't appear to be associated with a possibly-still-in-development feature (e.g. lifetime dependence, performance hints, etc)

@jamieQ
Copy link
Contributor Author

jamieQ commented Nov 3, 2025

@swift-ci please smoke test

NOTE(scanner_cycle_source_target_shadow_module, none,
"source target '%0' shadowing a%select{ |n SDK }2Swift module with the same name at: '%1'", (StringRef, StringRef, bool))

ERROR(scanner_arguments_invalid, none,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: 41e4712

"unknown library level '%0', "
"expected one of 'api', 'spi', 'ipi', or 'other'", (StringRef))

ERROR(error_old_spi_only_import_unsupported, none,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: 9e93b7b

Comment on lines -308 to -314
ERROR(error_create_symbolic_interfaces_dir,none,
"creating symbolic interfaces directory: %0", (StringRef))
ERROR(error_symbolic_interfaces_failed_status_check,none,
"failed file status check: %0", (StringRef))
ERROR(error_write_symbolic_interface,none,
"writing symbolic interface file: %0", (StringRef))
REMARK(remark_emitting_symbolic_interface_module,none,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last uses: b51cfa5

Comment on lines -323 to -327
ERROR(error_formatting_multiple_file_ranges,none,
"file ranges don't support multiple input files", ())

ERROR(error_formatting_invalid_range,none,
"file range is invalid", ())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: 6443619

// Caching related diagnostics
GROUPED_ERROR(error_caching_no_cas_fs, CompilationCaching, none,
"caching is enabled without CAS file-system options, input is not immutable", ())
ERROR(error_prefix_mapping, none, "cannot create scanner prefix mapping: '%0'", (StringRef))
Copy link
Contributor Author

@jamieQ jamieQ Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: 0384347

  • TODO: verify removal – cc @sina-mahdavi could you confirm whether it is expected that this is unused please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit: looks like the error was introduced here, but the error handling function it was for (llvm::MappedPrefix::transformJoined) is no longer used, so seems reasonable to remove.

"transitive dependency on '%0'",
(StringRef, Identifier, unsigned))

REMARK(explicit_interface_build_skipped,none,
Copy link
Contributor Author

@jamieQ jamieQ Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: 4cdbcb8

  • TODO: verify removal

"protocol %0 can not yet be represented in C++", (ValueDecl *))
ERROR(expose_move_only_to_cxx,none,
"noncopyable %kind0 can not yet be represented in C++", (ValueDecl *))
ERROR(expose_nested_type_to_cxx,none,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: 8603dfe

"actor boundary",
(Type, const ValueDecl *, ActorIsolation))

ERROR(non_sendable_call_result_type,none,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: cff835e

ERROR(invalid_ownership_not_optional,none,
"%0 variable should have optional type %1",
(ReferenceOwnership, Type))
ERROR(invalid_ownership_is_let,none,
Copy link
Contributor Author

@jamieQ jamieQ Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: 89f8f8b

  • TODO: verify removal – cc @nickolas-pohilets i see this was recently(ish) removed for the 'weak let' feature, rather than becoming conditional on the presence of that feature itself; is that expected/intentional?

Copy link
Contributor Author

@jamieQ jamieQ Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit: upon further inspection, i think this was the desired behavior – weak let is now unconditionally supported, but the mutability of weak captures is the thing controlled via the upcoming feature flag. thus, the error is no longer applicable. do correct me if i'm mistaken.

none, "'@_noImplicitCopy' attribute can only be applied to local lets and params", ())
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,
Copy link
Contributor Author

@jamieQ jamieQ Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last use: 7dbab5e

  • TODO: verify missing use is not a bug (SE-390 obviates this)

@jamieQ jamieQ marked this pull request as ready for review November 3, 2025 14:32
@jamieQ
Copy link
Contributor Author

jamieQ commented Nov 3, 2025

@swift-ci please clean smoke test macos

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thank you.

@jamieQ
Copy link
Contributor Author

jamieQ commented Nov 4, 2025

@artemcm thank you for the review! i've now convinced myself all of these seem reasonable to remove – idk what the protocol is for merging something like this, though i'd prefer it be merged sooner rather than later to reduce the likelihood of conflicts if possible. if that seems alright to you, please merge at your convenience. 🙇

@artemcm artemcm merged commit d1529b5 into swiftlang:main Nov 4, 2025
3 checks passed
@jamieQ jamieQ deleted the dead-diags branch November 4, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants