Make lint groups work correctly with warningsAsInfo and warningsAsHint
This commit is contained in:
@@ -282,3 +282,21 @@ pub fn for_each_break_expr(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Checks if the given lint is equal or is contained by the other lint which may or may not be a group.
|
||||
pub fn lint_eq_or_in_group(lint: &str, lint_is: &str) -> bool {
|
||||
if lint == lint_is {
|
||||
return true;
|
||||
}
|
||||
|
||||
if let Some(group) = generated_lints::DEFAULT_LINT_GROUPS
|
||||
.iter()
|
||||
.chain(generated_lints::CLIPPY_LINT_GROUPS.iter())
|
||||
.chain(generated_lints::RUSTDOC_LINT_GROUPS.iter())
|
||||
.find(|&check| check.lint.label == lint_is)
|
||||
{
|
||||
group.children.contains(&lint)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user