From c771f339d73e2a02c5a61734ffa3106721407265 Mon Sep 17 00:00:00 2001 From: "A.A.Abroskin" Date: Wed, 23 Jan 2019 11:49:02 +0300 Subject: [PATCH] allow assertions_on_constants for collapsible_if and missing_test_files --- clippy_lints/src/assertions_on_constants.rs | 9 --------- tests/missing-test-files.rs | 2 ++ tests/ui/assertions_on_constants.rs | 9 --------- tests/ui/assertions_on_constants.stderr | 12 ++++++------ tests/ui/attrs.rs | 2 +- tests/ui/collapsible_if.fixed | 2 +- tests/ui/collapsible_if.rs | 2 +- tests/ui/empty_line_after_outer_attribute.rs | 2 +- tests/ui/panic_unimplemented.rs | 2 +- 9 files changed, 13 insertions(+), 29 deletions(-) diff --git a/clippy_lints/src/assertions_on_constants.rs b/clippy_lints/src/assertions_on_constants.rs index f88ef8e83edb7..a148cb1c3a6f2 100644 --- a/clippy_lints/src/assertions_on_constants.rs +++ b/clippy_lints/src/assertions_on_constants.rs @@ -1,12 +1,3 @@ -// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - use crate::consts::{constant, Constant}; use crate::rustc::hir::{Expr, ExprKind}; use crate::rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; diff --git a/tests/missing-test-files.rs b/tests/missing-test-files.rs index 558e001d3d10b..bd0cee7564442 100644 --- a/tests/missing-test-files.rs +++ b/tests/missing-test-files.rs @@ -1,3 +1,5 @@ +#![allow(clippy::assertions_on_constants)] + use std::fs::{self, DirEntry}; use std::path::Path; diff --git a/tests/ui/assertions_on_constants.rs b/tests/ui/assertions_on_constants.rs index dcefe83f8c2f9..daeceebd3a2c7 100644 --- a/tests/ui/assertions_on_constants.rs +++ b/tests/ui/assertions_on_constants.rs @@ -1,12 +1,3 @@ -// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - fn main() { assert!(true); assert!(false); diff --git a/tests/ui/assertions_on_constants.stderr b/tests/ui/assertions_on_constants.stderr index 1f1a80e0e77b9..e8001acceb1ec 100644 --- a/tests/ui/assertions_on_constants.stderr +++ b/tests/ui/assertions_on_constants.stderr @@ -1,5 +1,5 @@ error: assert!(true) will be optimized out by the compiler - --> $DIR/assertions_on_constants.rs:11:5 + --> $DIR/assertions_on_constants.rs:2:5 | LL | assert!(true); | ^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | assert!(true); = help: remove it error: assert!(false) should probably be replaced - --> $DIR/assertions_on_constants.rs:12:5 + --> $DIR/assertions_on_constants.rs:3:5 | LL | assert!(false); | ^^^^^^^^^^^^^^^ @@ -16,7 +16,7 @@ LL | assert!(false); = help: use panic!() or unreachable!() error: assert!(true) will be optimized out by the compiler - --> $DIR/assertions_on_constants.rs:13:5 + --> $DIR/assertions_on_constants.rs:4:5 | LL | assert!(true, "true message"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -24,7 +24,7 @@ LL | assert!(true, "true message"); = help: remove it error: assert!(false) should probably be replaced - --> $DIR/assertions_on_constants.rs:14:5 + --> $DIR/assertions_on_constants.rs:5:5 | LL | assert!(false, "false message"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -32,7 +32,7 @@ LL | assert!(false, "false message"); = help: use panic!() or unreachable!() error: assert!(const: true) will be optimized out by the compiler - --> $DIR/assertions_on_constants.rs:17:5 + --> $DIR/assertions_on_constants.rs:8:5 | LL | assert!(B); | ^^^^^^^^^^^ @@ -40,7 +40,7 @@ LL | assert!(B); = help: remove it error: assert!(const: false) should probably be replaced - --> $DIR/assertions_on_constants.rs:20:5 + --> $DIR/assertions_on_constants.rs:11:5 | LL | assert!(C); | ^^^^^^^^^^^ diff --git a/tests/ui/attrs.rs b/tests/ui/attrs.rs index df7eafc65518b..91b65a43be77f 100644 --- a/tests/ui/attrs.rs +++ b/tests/ui/attrs.rs @@ -1,5 +1,5 @@ #![warn(clippy::inline_always, clippy::deprecated_semver)] -#![allow(clippy::assertions_on_constants::assertions_on_constants)] +#![allow(clippy::assertions_on_constants)] #[inline(always)] fn test_attr_lint() { assert!(true) diff --git a/tests/ui/collapsible_if.fixed b/tests/ui/collapsible_if.fixed index 2c6dd95a63799..3c7de56406eee 100644 --- a/tests/ui/collapsible_if.fixed +++ b/tests/ui/collapsible_if.fixed @@ -1,5 +1,5 @@ // run-rustfix -#![allow(clippy::cyclomatic_complexity)] +#![allow(clippy::cyclomatic_complexity, clippy::assertions_on_constants)] #[rustfmt::skip] #[warn(clippy::collapsible_if)] diff --git a/tests/ui/collapsible_if.rs b/tests/ui/collapsible_if.rs index f482d7704def9..e46d753757741 100644 --- a/tests/ui/collapsible_if.rs +++ b/tests/ui/collapsible_if.rs @@ -1,5 +1,5 @@ // run-rustfix -#![allow(clippy::cyclomatic_complexity)] +#![allow(clippy::cyclomatic_complexity, clippy::assertions_on_constants)] #[rustfmt::skip] #[warn(clippy::collapsible_if)] diff --git a/tests/ui/empty_line_after_outer_attribute.rs b/tests/ui/empty_line_after_outer_attribute.rs index 3af8e3eeac087..b43dc20082523 100644 --- a/tests/ui/empty_line_after_outer_attribute.rs +++ b/tests/ui/empty_line_after_outer_attribute.rs @@ -1,5 +1,5 @@ #![warn(clippy::empty_line_after_outer_attr)] -#![allow(clippy::assertions_on_constants::assertions_on_constants)] +#![allow(clippy::assertions_on_constants)] // This should produce a warning #[crate_type = "lib"] diff --git a/tests/ui/panic_unimplemented.rs b/tests/ui/panic_unimplemented.rs index a7c5b91fdb560..92290da8a6ac0 100644 --- a/tests/ui/panic_unimplemented.rs +++ b/tests/ui/panic_unimplemented.rs @@ -1,5 +1,5 @@ #![warn(clippy::panic_params, clippy::unimplemented)] -#![allow(clippy::assertions_on_constants::assertions_on_constants)] +#![allow(clippy::assertions_on_constants)] fn missing() { if true { panic!("{}");