Update doc generation script

This commit is contained in:
ThibsG 2020-03-23 22:07:46 +01:00
parent 380f7218b3
commit 629cc4ada3
4 changed files with 8 additions and 7 deletions

View File

@ -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;

View File

@ -231,6 +231,7 @@ mod inline_fn_without_body;
mod int_plus_one;
mod integer_division;
mod items_after_statements;
mod large_const_arrays;
mod large_enum_variant;
mod large_stack_arrays;
mod len_zero;

View File

@ -150,7 +150,7 @@ define_Conf! {
(trivial_copy_size_limit, "trivial_copy_size_limit": Option<u64>, 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),

View File

@ -14,7 +14,7 @@ lintname_re = re.compile(r'''pub\s+([A-Z_][A-Z_0-9]*)''')
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