Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions crates/ide-completion/src/tests/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,16 @@ mod lint {
r#"#[allow(rustdoc::bare_urls struct Test;"#,
);
}

#[test]
fn no_duplicate_warnings_lint() {
let completions = crate::tests::completion_list(r#"#[allow(w$0)] struct Test;"#);
let warning_count = completions.lines().filter(|line| line.contains("warnings")).count();
assert_eq!(
warning_count, 1,
"Expected `warnings` to appear exactly once, but found {warning_count} occurrences:\n{completions}"
);
}
}

mod repr {
Expand Down
7 changes: 0 additions & 7 deletions crates/ide-db/src/generated/lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1608,13 +1608,6 @@ pub const DEFAULT_LINTS: &[Lint] = &[
warn_since: None,
deny_since: None,
},
Lint {
label: "warnings",
description: r##"lint group for: all lints that are set to issue warnings"##,
default_severity: Severity::Allow,
warn_since: None,
deny_since: None,
},
];

pub const DEFAULT_LINT_GROUPS: &[LintGroup] = &[
Expand Down
8 changes: 6 additions & 2 deletions xtask/src/codegen/lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,9 @@ fn generate_lint_descriptor(sh: &Shell, buf: &mut String) {
push_lint_completion(buf, name, lint);
}
for (name, (group, _)) in &lint_groups {
push_lint_completion(buf, name, group);
if !lints.iter().any(|(n, _)| n == name) {
push_lint_completion(buf, name, group);
}
}
buf.push_str("];\n\n");

Expand All @@ -376,7 +378,9 @@ fn generate_lint_descriptor(sh: &Shell, buf: &mut String) {
push_lint_completion(buf, name, lint);
}
for (name, (group, _)) in &lint_groups_rustdoc {
push_lint_completion(buf, name, group);
if !lints_rustdoc.iter().any(|(n, _)| n == name) {
push_lint_completion(buf, name, group);
}
}
buf.push_str("];\n\n");

Expand Down