From 7905473021ee75338381d94d51a829c568ad4ae8 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 7 Jun 2021 13:40:59 -0700 Subject: [PATCH] Fix force-warns to allow dashes. --- compiler/rustc_session/src/config.rs | 3 ++- src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 57522582683..95d5fc188e2 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -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) } diff --git a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs index fd029a3d55c..d8a81d73afb 100644 --- a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs +++ b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs @@ -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)]