Skip to content

Test that all interned symbols are referenced in Clippy sources #14842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samueltardieu
Copy link
Contributor

@samueltardieu samueltardieu commented May 18, 2025

This test checks that all symbols defined in Clippy's sym.rs file are used in Clippy. Otherwise, it will fail with a list of symbols which are unused.

This test only runs when the internal feature is set, to allow developers to temporarily define new, yet unused symbols without failing the tests. Also, it will not run as part of the compiler test suite, as an extra symbol should never be seen as a fatal problem in the compiler repo.

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented May 18, 2025

r? @Alexendoo

rustbot has assigned @Alexendoo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 18, 2025
@rustbot

This comment has been minimized.

@samueltardieu
Copy link
Contributor Author

Rebased

Comment on lines 7 to 10
// This test only runs when the `internal` feature is set, to allow
// developers to temporarily define new, yet unused symbols without
// failing the tests. Also, the test is a no-op if run as part of the
// compiler test suite.
Copy link
Member

Choose a reason for hiding this comment

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

IMO ditch the cfg, it's surprising that a test that doesn't require internals gets skipped without it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment on lines 51 to 49
#[tokio::test]
#[allow(clippy::case_sensitive_file_extension_comparisons)]
async fn all_symbols_are_used() -> Result<()> {
Copy link
Member

Choose a reason for hiding this comment

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

Since we're just using tokio for its threadpool here perhaps used_symbols should use rayon instead, the other things can run serially

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I was reluctant to add rayon as a new dependency, I'll make the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants