Let update_lints also generate the internal lints

This commit is contained in:
flip1995
2020-02-11 11:11:43 +01:00
parent 3da2c9183a
commit 4a9bfe4184
3 changed files with 10 additions and 3 deletions

View File

@@ -61,6 +61,11 @@ impl Lint {
lints.filter(|l| l.deprecation.is_none() && !l.is_internal())
}
/// Returns all internal lints (not `internal_warn` lints)
pub fn internal_lints(lints: impl Iterator<Item = Self>) -> impl Iterator<Item = Self> {
lints.filter(|l| l.group == "internal")
}
/// Returns the lints in a `HashMap`, grouped by the different lint groups
#[must_use]
pub fn by_lint_group(lints: impl Iterator<Item = Self>) -> HashMap<String, Vec<Self>> {
@@ -79,7 +84,7 @@ pub fn gen_lint_group_list(lints: Vec<Lint>) -> Vec<String> {
lints
.into_iter()
.filter_map(|l| {
if l.is_internal() || l.deprecation.is_some() {
if l.deprecation.is_some() {
None
} else {
Some(format!(" LintId::of(&{}::{}),", l.module, l.name.to_uppercase()))