]> git.lizzy.rs Git - rust.git/commitdiff
Add mention of warnings lint group to help message
authorMike Anderson <hello@mrmikea.com>
Mon, 4 Jan 2016 16:54:30 +0000 (10:54 -0600)
committerMike Anderson <hello@mrmikea.com>
Mon, 4 Jan 2016 18:28:35 +0000 (12:28 -0600)
src/librustc_driver/lib.rs

index 210b1a26c21f18cc1aafee3489fe2ea53c3d0b4b..99d30f3bcfb9937667063ac33e5152ecf70adf24 100644 (file)
@@ -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 {