Auto merge of #86117 - ehuss:force-warns-underscore, r=rylev

Fix force-warns to allow dashes.

The `--force-warns` flag was not allowing lint names with dashes, only supporting underscores.  This changes it to allow dashes to match the behavior of the A/W/D/F flags.
This commit is contained in:
bors 2021-06-14 17:21:28 +00:00
commit 304441960e
2 changed files with 3 additions and 2 deletions

View File

@ -1207,7 +1207,8 @@ pub fn get_cmd_lint_options(
);
}
let force_warns = matches.opt_strs("force-warns");
let force_warns =
matches.opt_strs("force-warns").into_iter().map(|name| name.replace('-', "_")).collect();
(lint_opts, describe_lints, lint_cap, force_warns)
}

View File

@ -1,4 +1,4 @@
// compile-flags: --force-warns rust_2018_idioms -Zunstable-options
// compile-flags: --force-warns rust-2018-idioms -Zunstable-options
// check-pass
#![allow(bare_trait_objects)]