From b9e3b0755c037dc59aaee2402ee1de561146566b Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sat, 24 Feb 2024 16:08:28 +0300 Subject: [PATCH] use `--cap-lints` only when deny and forbid rules are not specified Signed-off-by: onur-ozkan --- src/bootstrap/src/core/build_steps/check.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 4d13cf94d918..55180a82885b 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -61,10 +61,15 @@ fn args(builder: &Builder<'_>) -> Vec { } } - let all_args = std::env::args().collect::>(); + args.extend(strings(&["--"])); + + if deny.is_empty() && forbid.is_empty() { + args.extend(strings(&["--cap-lints", "warn"])); + } - args.extend(strings(&["--", "--cap-lints", "warn"])); + let all_args = std::env::args().collect::>(); args.extend(get_clippy_rules_in_order(&all_args, allow, deny, warn, forbid)); + args.extend(ignored_lints.iter().map(|lint| format!("-Aclippy::{}", lint))); args.extend(builder.config.free_args.clone()); args