Provide all lint group names to Clippy

Unblocks https://github.com/rust-lang/rust-clippy/pull/14689
This commit is contained in:
Alex Macleod 2026-02-14 17:14:51 +00:00
parent 5d04477ea8
commit 54875f6835
2 changed files with 6 additions and 1 deletions

View file

@ -154,6 +154,11 @@ impl LintStore {
})
}
/// Returns all lint group names, including deprecated/aliased groups
pub fn get_all_group_names(&self) -> impl Iterator<Item = &'static str> {
self.lint_groups.keys().copied()
}
pub fn register_early_pass(
&mut self,
pass: impl Fn() -> EarlyLintPassObject + 'static + sync::DynSend + sync::DynSync,

View file

@ -135,7 +135,7 @@ pub fn check(cx: &LateContext<'_>) {
{
let mut rustc_groups = FxHashSet::default();
let mut clippy_groups = FxHashSet::default();
for (group, ..) in unerased_lint_store(cx.tcx.sess).get_lint_groups() {
for group in unerased_lint_store(cx.tcx.sess).get_all_group_names() {
match group.split_once("::") {
None => {
rustc_groups.insert(group);