diff options
| author | Mike Anderson <hello@mrmikea.com> | 2016-01-04 10:54:30 -0600 |
|---|---|---|
| committer | Mike Anderson <hello@mrmikea.com> | 2016-01-04 12:28:35 -0600 |
| commit | 6c8dd522dfcde0f6f799120dd60b28278ea7d628 (patch) | |
| tree | 7bccfc1010890a734fdcf47b078d081eb7719180 | |
| parent | 191ff2d8fd57a8238d85302a8f06e2bd11b2f6d2 (diff) | |
| download | rust-6c8dd522dfcde0f6f799120dd60b28278ea7d628.tar.gz rust-6c8dd522dfcde0f6f799120dd60b28278ea7d628.zip | |
Add mention of warnings lint group to help message
| -rw-r--r-- | src/librustc_driver/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 210b1a26c21..99d30f3bcfb 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -70,6 +70,7 @@ use rustc_metadata::loader; 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 @@ Available lint options: .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 @@ Available lint options: 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 { |
