Skip to content
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

Remove unused symbols and diagnostic items #104383

Merged
merged 3 commits into from
Nov 15, 2022

Conversation

WaffleLapkin
Copy link
Member

As the title suggests, this removes unused symbols from sym:: and #[rustc_diagnostic_item] annotations that weren't mentioned anywhere.

Originally I tried to use grep, to find symbols and item names that are never mentioned via sym::name, however this produced a lot of false positives (?), for example clippy matching on Symbol::as_str or macros "implicitly" adding sym::. I ended up fixing all these false positives (?) by hand, but tbh I'm not sure if it was worth it...

please, please, don't match on `Symbol::as_str`s, every time you do,
somewhere in the world another waffle becomes sad...
@rustbot
Copy link
Collaborator

rustbot commented Nov 13, 2022

r? @eholk

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 13, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 13, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@WaffleLapkin
Copy link
Member Author

WaffleLapkin commented Nov 13, 2022

@rustbot label -T-libs

@rustbot rustbot removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Nov 13, 2022
@compiler-errors
Copy link
Member

r? @compiler-errors @bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 14, 2022

📌 Commit 29fe28f has been approved by compiler-errors

It is now in the queue for this repository.

@rustbot rustbot assigned compiler-errors and unassigned eholk Nov 14, 2022
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 14, 2022
@bjorn3
Copy link
Member

bjorn3 commented Nov 14, 2022

Shouldn't this get a perf run? Removing symbols from the pre-interned list can impact performance.

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 15, 2022
…iaskrgr

Rollup of 13 pull requests

Successful merges:

 - rust-lang#103842 (Adding Fuchsia compiler testing script, docs)
 - rust-lang#104354 (Remove leading newlines from `NonZero*` doc examples)
 - rust-lang#104372 (Update compiler-builtins)
 - rust-lang#104380 (rustdoc: remove unused CSS `code { opacity: 1 }`)
 - rust-lang#104381 (Remove dead NoneError diagnostic handling)
 - rust-lang#104383 (Remove unused symbols and diagnostic items)
 - rust-lang#104391 (Deriving cleanups)
 - rust-lang#104403 (Specify language of code comment to generate document)
 - rust-lang#104404 (Fix missing minification for static files)
 - rust-lang#104413 ([llvm-wrapper] adapt for LLVM API change)
 - rust-lang#104415 (rustdoc: fix corner case in search keyboard commands)
 - rust-lang#104422 (Fix suggest associated call syntax)
 - rust-lang#104426 (Add test for rust-lang#102154)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2c29b05 into rust-lang:master Nov 15, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 15, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 17, 2022
…r=compiler-errors

Readd the matches_macro diag item

This is now used by Clippy

r? `@compiler-errors`

This was removed in rust-lang#104383. But in the meantime Clippy now makes use of it https://github.com/rust-lang/rust-clippy/blob/dac600e32fce89cb4b05ae6edb0c47982b99eb48/clippy_lints/src/manual_is_ascii_check.rs#L153

---

This is blocking the Clippy sync. (kinda. I could work around it, but I don't want to play ping-pong with this change.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants