allow assertions_on_constants for collapsible_if and missing_test_files
This commit is contained in:
parent
f11d993c0f
commit
c771f339d7
@ -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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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};
|
||||
|
@ -1,3 +1,5 @@
|
||||
#![allow(clippy::assertions_on_constants)]
|
||||
|
||||
use std::fs::{self, DirEntry};
|
||||
use std::path::Path;
|
||||
|
||||
|
@ -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 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
assert!(true);
|
||||
assert!(false);
|
||||
|
@ -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);
|
||||
| ^^^^^^^^^^^
|
||||
|
@ -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)
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run-rustfix
|
||||
#![allow(clippy::cyclomatic_complexity)]
|
||||
#![allow(clippy::cyclomatic_complexity, clippy::assertions_on_constants)]
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[warn(clippy::collapsible_if)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
// run-rustfix
|
||||
#![allow(clippy::cyclomatic_complexity)]
|
||||
#![allow(clippy::cyclomatic_complexity, clippy::assertions_on_constants)]
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[warn(clippy::collapsible_if)]
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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!("{}");
|
||||
|
Loading…
Reference in New Issue
Block a user