Skip to content

Fix new_lint clippy command #14642

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

Merged
merged 1 commit into from
May 2, 2025
Merged

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Apr 17, 2025

I'm working on #14542 and I decided to name the lint unnecessary_map originally. However when I ran the command, I got:

thread 'main' panicked at clippy_dev/src/new_lint.rs:450:5:
Lint `unnecessary_map` already defined in `/home/imperio/rust/clippy/clippy_lints/src/methods/mod.rs`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It's because there is already a unnecessary_map_or, which matches the .contains() call. This PR strengthens this check.

changelog: Fix new_lint clippy command

r? @flip1995

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 17, 2025
@GuillaumeGomez
Copy link
Member Author

r? clippy

@rustbot rustbot assigned Manishearth and unassigned flip1995 May 2, 2025
Copy link
Contributor

@Jarcho Jarcho left a comment

Choose a reason for hiding this comment

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

This is better than what it currently does.

@Jarcho Jarcho added this pull request to the merge queue May 2, 2025
Merged via the queue into rust-lang:master with commit fb9508d May 2, 2025
13 checks passed
@GuillaumeGomez GuillaumeGomez deleted the new-lint branch May 2, 2025 20:17
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.

5 participants