Skip to content

perf: check names before context in the used-underscore lints - #17408

Closed
xmakro wants to merge 1 commit into
rust-lang:masterfrom
xmakro:split-underscore
Closed

xmakro wants to merge 1 commit into
rust-lang:masterfrom
xmakro:split-underscore

Conversation

@xmakro

@xmakro xmakro commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

The shared context guard for used_underscore_binding and used_underscore_items (external-macro, desugaring, and automatically-derived checks) is expensive and ran on every expression, though the lints can only fire on names starting with a single underscore.

crate change
syn 2.0.71 -0.64%
serde 1.0.204 -0.79%
wasmi 0.35.0 -0.47%
regex 1.10.5 -0.34%
ryu 1.0.18 -1.38%

changelog: none

@xmakro
xmakro marked this pull request as ready for review July 12, 2026 03:30
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. labels Jul 12, 2026
@Jarcho

Jarcho commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

#17308 also does this.

@CommanderStorm CommanderStorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Community review:

I like #17308 a lot more than this solution.

Modeling "the full state space" using enums is much nicer longer-term 👍🏻

View changes since this review

@rustbot

rustbot commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #17308) made this pull request unmergeable. Please resolve the merge conflicts.

@xmakro

xmakro commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing since #17308 was merged

@xmakro xmakro closed this Aug 16, 2026
@rustbot rustbot removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. labels Aug 16, 2026
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.

4 participants