Skip to content

fix: deduplicate warnings lint in completion list#22005

Closed
barry3406 wants to merge 1 commit intorust-lang:masterfrom
barry3406:fix-duplicate-warnings-lint
Closed

fix: deduplicate warnings lint in completion list#22005
barry3406 wants to merge 1 commit intorust-lang:masterfrom
barry3406:fix-duplicate-warnings-lint

Conversation

@barry3406
Copy link
Copy Markdown

@barry3406 barry3406 commented Apr 9, 2026

Fixes #21943

warnings shows up twice when completing #[allow(w because it exists as both a regular lint and a lint group in rustc -Whelp output. The codegen in xtask/src/codegen/lints.rs writes both into DEFAULT_LINTS without deduplication.

Fix: When iterating lint groups to append to the combined list, skip any group whose name already appeared in the regular lints. Applied the same check for RUSTDOC_LINTS.

Also regenerated crates/ide-db/src/generated/lints.rs to remove the existing duplicate, and added a regression test that verifies warnings appears exactly once.

AI disclosure: Used Claude as a coding assistant. I reviewed and verified all changes.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 9, 2026
@rustbot

This comment has been minimized.

The `warnings` lint appeared twice in `#[allow(w` completions because
it exists as both a regular lint and a lint group in `rustc -Whelp`
output. The codegen concatenated both into DEFAULT_LINTS without
checking for overlap.

Skip lint groups whose name already appears in the regular lint list
when generating DEFAULT_LINTS and RUSTDOC_LINTS. Also regenerated the
lints.rs file to remove the current duplicate.

Fixes rust-lang#21943
@barry3406

This comment was marked as low quality.

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 12, 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.

Duplicate warnings lint complete

2 participants