Skip to content

extract duplicate_underscore_argument, and move it into functions - #15508

Merged
y21 merged 1 commit into
rust-lang:masterfrom
ada4a:misc-early
Aug 21, 2025
Merged

y21 merged 1 commit into
rust-lang:masterfrom
ada4a:misc-early

Conversation

@ada4a

@ada4a ada4a commented Aug 17, 2025 •

Copy link
Copy Markdown
Contributor

Basically continuing the work in #6680

Honestly I think the lint could also be run on (trait) impl items, but I didn't implement that because of the feature freeze. If that is deemed okay to add in this PR though, I could happily do so.

changelog: none

@rustbot

rustbot commented Aug 17, 2025

Copy link
Copy Markdown
Collaborator

r? @y21

rustbot has assigned @y21.
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 Aug 17, 2025
@github-actions

github-actions Bot commented Aug 17, 2025 •

Copy link
Copy Markdown

No changes for 54c52e2

@rustbot rustbot added S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work A-lint Area: New lints and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 17, 2025
@ada4a

ada4a commented Aug 17, 2025

Copy link
Copy Markdown
Contributor Author

I'm still not..

@rustbot label -S-blocked -A-lint +S-waiting-on-review
@rustbot note remove Feature-freeze

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work A-lint Area: New lints labels Aug 17, 2025
@ada4a
ada4a marked this pull request as draft August 17, 2025 22:12
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 17, 2025
@ada4a
ada4a marked this pull request as ready for review August 18, 2025 17:21
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 18, 2025
@ada4a

ada4a commented Aug 18, 2025

Copy link
Copy Markdown
Contributor Author

Hm, somehow extracting the lint to a separate module was fine, but moving it to another lint pass was not? I even tried to create a separate FunctionsEarly pass with just this lint, but that didn't work either..

@y21

y21 commented Aug 19, 2025

Copy link
Copy Markdown
Member

You'll need to register it as an early lint pass as well:

store.register_late_pass(move |tcx| Box::new(functions::Functions::new(tcx, conf)));

But that will probably not work since Functions::new needs a TyCtxt which is not available at that point, so you'll likely have to split it up into a separate EarlyFunctions lint pass. You can look at attrs/mod.rs. That "group" also has both early and late lints

@ada4a

ada4a commented Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

Thank you very much! With that, everything worked out perfectly

@y21 y21 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, LGTM! Can you squash the commits?

misc: use `str::starts_with`

extract `duplicate_underscore_argument` into a module

move it to `functions`
@ada4a

ada4a commented Aug 19, 2025

Copy link
Copy Markdown
Contributor Author

squashed (and rebased)!

@y21
y21 added this pull request to the merge queue Aug 21, 2025
Merged via the queue into rust-lang:master with commit 763420c Aug 21, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 21, 2025
@ada4a
ada4a deleted the misc-early branch August 21, 2025 08:16
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.

3 participants