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

Too much kw::Empty usage #137978

Open
nnethercote opened this issue Mar 4, 2025 · 1 comment
Open

Too much kw::Empty usage #137978

nnethercote opened this issue Mar 4, 2025 · 1 comment
Assignees
Labels
A-technical-debt Area: Internal cleanup work needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nnethercote
Copy link
Contributor

kw::Empty is the name of the empty Symbol. It's used a lot. Most places it's used, it's hard to tell if it means "empty symbol" or "no symbol". I.e. it more or less reinvents the null pointer, something that Rust was supposed to get rid of.

I think a lot of the uses could be removed by using Option<Symbol> instead of Symbol, making the "no symbol" cases much clearer.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 4, 2025
@nnethercote nnethercote self-assigned this Mar 4, 2025
@nnethercote
Copy link
Contributor Author

nnethercote commented Mar 4, 2025

#137977 is the first step here. The backstory: I grepped for kw::Empty, looked at the very first occurrence in the output, worked out how to eliminate it, removing 17 kw::Empty occurrences, and I unintentionally fixed a crashtest in the process. A promising start.

@nnethercote nnethercote added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-technical-debt Area: Internal cleanup work labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-technical-debt Area: Internal cleanup work needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants