From 41ceca790e30bfa04e1da2bf738128033b6eff1f Mon Sep 17 00:00:00 2001 From: ThibsG Date: Mon, 23 Mar 2020 22:07:46 +0100 Subject: [PATCH] Update doc generation script --- README.md | 2 +- clippy_lints/src/large_const_arrays.rs | 4 ++-- clippy_lints/src/utils/conf.rs | 2 +- src/lintlist/mod.rs | 2 +- util/lintlib.py | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 856058e58b02..b32046755b7a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code. -[There are 363 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html) +[There are 364 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html) We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you: diff --git a/clippy_lints/src/large_const_arrays.rs b/clippy_lints/src/large_const_arrays.rs index 2f62e6ad9dc5..4c3030cf2e7c 100644 --- a/clippy_lints/src/large_const_arrays.rs +++ b/clippy_lints/src/large_const_arrays.rs @@ -1,11 +1,11 @@ use crate::rustc_target::abi::LayoutOf; use crate::utils::span_lint_and_then; use if_chain::if_chain; -use rustc::mir::interpret::ConstValue; -use rustc::ty::{self, ConstKind}; use rustc_errors::Applicability; use rustc_hir::{Item, ItemKind}; use rustc_lint::{LateContext, LateLintPass}; +use rustc_middle::mir::interpret::ConstValue; +use rustc_middle::ty::{self, ConstKind}; use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::{BytePos, Pos, Span}; use rustc_typeck::hir_ty_to_ty; diff --git a/clippy_lints/src/utils/conf.rs b/clippy_lints/src/utils/conf.rs index 722104e5b524..afcfe34f5be8 100644 --- a/clippy_lints/src/utils/conf.rs +++ b/clippy_lints/src/utils/conf.rs @@ -150,7 +150,7 @@ define_Conf! { (trivial_copy_size_limit, "trivial_copy_size_limit": Option, None), /// Lint: TOO_MANY_LINES. The maximum number of lines a function or method can have (too_many_lines_threshold, "too_many_lines_threshold": u64, 100), - /// Lint: LARGE_STACK_ARRAYS. The maximum allowed size for arrays on the stack + /// Lint: LARGE_STACK_ARRAYS, LARGE_CONST_ARRAYS. The maximum allowed size for arrays on the stack (array_size_threshold, "array_size_threshold": u64, 512_000), /// Lint: VEC_BOX. The size of the boxed type in bytes, where boxing in a `Vec` is allowed (vec_box_size_threshold, "vec_box_size_threshold": u64, 4096), diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs index e080b4dd9089..441787e9cfd3 100644 --- a/src/lintlist/mod.rs +++ b/src/lintlist/mod.rs @@ -6,7 +6,7 @@ pub use lint::Lint; pub use lint::LINT_LEVELS; // begin lint list, do not remove this comment, it’s used in `update_lints` -pub const ALL_LINTS: [Lint; 363] = [ +pub const ALL_LINTS: [Lint; 364] = [ Lint { name: "absurd_extreme_comparisons", group: "correctness", diff --git a/util/lintlib.py b/util/lintlib.py index 16cc6ccfdae3..d0d9beb9b2d9 100644 --- a/util/lintlib.py +++ b/util/lintlib.py @@ -14,7 +14,7 @@ group_re = re.compile(r'''\s*([a-z_][a-z_0-9]+)''') conf_re = re.compile(r'''define_Conf! {\n([^}]*)\n}''', re.MULTILINE) confvar_re = re.compile( - r'''/// Lint: (\w+)\. (.*)\n\s*\([^,]+,\s+"([^"]+)":\s+([^,]+),\s+([^\.\)]+).*\),''', re.MULTILINE) + r'''/// Lint: ([\w,\s]+)\. (.*)\n\s*\([^,]+,\s+"([^"]+)":\s+([^,]+),\s+([^\.\)]+).*\),''', re.MULTILINE) comment_re = re.compile(r'''\s*/// ?(.*)''') lint_levels = { @@ -93,9 +93,9 @@ def parse_configs(path): match = re.search(conf_re, contents) confvars = re.findall(confvar_re, match.group(1)) - for (lint, doc, name, ty, default) in confvars: - configs[lint.lower()] = Config(name.replace("_", "-"), ty, doc, default) - + for (lints, doc, name, ty, default) in confvars: + for lint in lints.split(','): + configs[lint.strip().lower()] = Config(name.replace("_", "-"), ty, doc, default) return configs