Skip to content

Commit 3cedc6a

Browse files
committed
Update doc generation script
1 parent 6cc195b commit 3cedc6a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

clippy_lints/src/large_const_arrays.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::rustc_target::abi::LayoutOf;
22
use crate::utils::span_lint_and_then;
33
use if_chain::if_chain;
4-
use rustc::mir::interpret::ConstValue;
5-
use rustc::ty::{self, ConstKind};
64
use rustc_errors::Applicability;
75
use rustc_hir::{Item, ItemKind};
86
use rustc_lint::{LateContext, LateLintPass};
7+
use rustc_middle::mir::interpret::ConstValue;
8+
use rustc_middle::ty::{self, ConstKind};
99
use rustc_session::{declare_tool_lint, impl_lint_pass};
1010
use rustc_span::{BytePos, Pos, Span};
1111
use rustc_typeck::hir_ty_to_ty;

clippy_lints/src/utils/conf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ define_Conf! {
150150
(trivial_copy_size_limit, "trivial_copy_size_limit": Option<u64>, None),
151151
/// Lint: TOO_MANY_LINES. The maximum number of lines a function or method can have
152152
(too_many_lines_threshold, "too_many_lines_threshold": u64, 100),
153-
/// Lint: LARGE_STACK_ARRAYS. The maximum allowed size for arrays on the stack
153+
/// Lint: LARGE_STACK_ARRAYS, LARGE_CONST_ARRAYS. The maximum allowed size for arrays on the stack
154154
(array_size_threshold, "array_size_threshold": u64, 512_000),
155155
/// Lint: VEC_BOX. The size of the boxed type in bytes, where boxing in a `Vec` is allowed
156156
(vec_box_size_threshold, "vec_box_size_threshold": u64, 4096),

util/lintlib.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
group_re = re.compile(r'''\s*([a-z_][a-z_0-9]+)''')
1515
conf_re = re.compile(r'''define_Conf! {\n([^}]*)\n}''', re.MULTILINE)
1616
confvar_re = re.compile(
17-
r'''/// Lint: (\w+)\. (.*)\n\s*\([^,]+,\s+"([^"]+)":\s+([^,]+),\s+([^\.\)]+).*\),''', re.MULTILINE)
17+
r'''/// Lint: ([\w,\s]+)\. (.*)\n\s*\([^,]+,\s+"([^"]+)":\s+([^,]+),\s+([^\.\)]+).*\),''', re.MULTILINE)
1818
comment_re = re.compile(r'''\s*/// ?(.*)''')
1919

2020
lint_levels = {
@@ -93,9 +93,9 @@ def parse_configs(path):
9393
match = re.search(conf_re, contents)
9494
confvars = re.findall(confvar_re, match.group(1))
9595

96-
for (lint, doc, name, ty, default) in confvars:
97-
configs[lint.lower()] = Config(name.replace("_", "-"), ty, doc, default)
98-
96+
for (lints, doc, name, ty, default) in confvars:
97+
for lint in lints.split(','):
98+
configs[lint.strip().lower()] = Config(name.replace("_", "-"), ty, doc, default)
9999
return configs
100100

101101

0 commit comments

Comments
 (0)