提交 6c8dd522 编写于 作者: M Mike Anderson

Add mention of warnings lint group to help message

上级 191ff2d8
......@@ -70,6 +70,7 @@
use rustc_metadata::cstore::CStore;
use rustc::util::common::time;
use std::cmp::max;
use std::cmp::Ordering::Equal;
use std::env;
use std::io::{self, Read, Write};
......@@ -632,6 +633,8 @@ fn sort_lint_groups(lints: Vec<(&'static str, Vec<lint::LintId>, bool)>)
.map(|&(s, _)| s.chars().count())
.max()
.unwrap_or(0);
let max_name_len = std::cmp::max(max_name_len, "warnings".len());
let padded = |x: &str| {
let mut s = repeat(" ")
.take(max_name_len - x.chars().count())
......@@ -643,6 +646,7 @@ fn sort_lint_groups(lints: Vec<(&'static str, Vec<lint::LintId>, bool)>)
println!("Lint groups provided by rustc:\n");
println!(" {} {}", padded("name"), "sub-lints");
println!(" {} {}", padded("----"), "---------");
println!(" {} {}", padded("warnings"), "all built-in lints");
let print_lint_groups = |lints: Vec<(&'static str, Vec<lint::LintId>)>| {
for (name, to) in lints {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册