mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
Leave note on non-rustfixable tests
This commit is contained in:
parent
329e224eba
commit
d29f6d28b5
5 changed files with 46 additions and 42 deletions
|
@ -1,3 +1,5 @@
|
|||
// does not test any rustfixable lints
|
||||
|
||||
#[rustfmt::skip]
|
||||
#[warn(clippy::eq_op)]
|
||||
#[allow(clippy::identity_op, clippy::double_parens, clippy::many_single_char_names)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: equal expressions as operands to `==`
|
||||
--> $DIR/eq_op.rs:9:5
|
||||
--> $DIR/eq_op.rs:11:5
|
||||
|
|
||||
LL | 1 == 1;
|
||||
| ^^^^^^
|
||||
|
@ -7,157 +7,157 @@ LL | 1 == 1;
|
|||
= note: `-D clippy::eq-op` implied by `-D warnings`
|
||||
|
||||
error: equal expressions as operands to `==`
|
||||
--> $DIR/eq_op.rs:10:5
|
||||
--> $DIR/eq_op.rs:12:5
|
||||
|
|
||||
LL | "no" == "no";
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `!=`
|
||||
--> $DIR/eq_op.rs:12:5
|
||||
--> $DIR/eq_op.rs:14:5
|
||||
|
|
||||
LL | false != false;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `<`
|
||||
--> $DIR/eq_op.rs:13:5
|
||||
--> $DIR/eq_op.rs:15:5
|
||||
|
|
||||
LL | 1.5 < 1.5;
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `>=`
|
||||
--> $DIR/eq_op.rs:14:5
|
||||
--> $DIR/eq_op.rs:16:5
|
||||
|
|
||||
LL | 1u64 >= 1u64;
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `&`
|
||||
--> $DIR/eq_op.rs:17:5
|
||||
--> $DIR/eq_op.rs:19:5
|
||||
|
|
||||
LL | (1 as u64) & (1 as u64);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `^`
|
||||
--> $DIR/eq_op.rs:18:5
|
||||
--> $DIR/eq_op.rs:20:5
|
||||
|
|
||||
LL | 1 ^ ((((((1))))));
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `<`
|
||||
--> $DIR/eq_op.rs:21:5
|
||||
--> $DIR/eq_op.rs:23:5
|
||||
|
|
||||
LL | (-(2) < -(2));
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `==`
|
||||
--> $DIR/eq_op.rs:22:5
|
||||
--> $DIR/eq_op.rs:24:5
|
||||
|
|
||||
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `&`
|
||||
--> $DIR/eq_op.rs:22:6
|
||||
--> $DIR/eq_op.rs:24:6
|
||||
|
|
||||
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `&`
|
||||
--> $DIR/eq_op.rs:22:27
|
||||
--> $DIR/eq_op.rs:24:27
|
||||
|
|
||||
LL | ((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1));
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `==`
|
||||
--> $DIR/eq_op.rs:23:5
|
||||
--> $DIR/eq_op.rs:25:5
|
||||
|
|
||||
LL | (1 * 2) + (3 * 4) == 1 * 2 + 3 * 4;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `!=`
|
||||
--> $DIR/eq_op.rs:26:5
|
||||
--> $DIR/eq_op.rs:28:5
|
||||
|
|
||||
LL | ([1] != [1]);
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `!=`
|
||||
--> $DIR/eq_op.rs:27:5
|
||||
--> $DIR/eq_op.rs:29:5
|
||||
|
|
||||
LL | ((1, 2) != (1, 2));
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `==`
|
||||
--> $DIR/eq_op.rs:31:5
|
||||
--> $DIR/eq_op.rs:33:5
|
||||
|
|
||||
LL | 1 + 1 == 2;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `==`
|
||||
--> $DIR/eq_op.rs:32:5
|
||||
--> $DIR/eq_op.rs:34:5
|
||||
|
|
||||
LL | 1 - 1 == 0;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `-`
|
||||
--> $DIR/eq_op.rs:32:5
|
||||
--> $DIR/eq_op.rs:34:5
|
||||
|
|
||||
LL | 1 - 1 == 0;
|
||||
| ^^^^^
|
||||
|
||||
error: equal expressions as operands to `-`
|
||||
--> $DIR/eq_op.rs:34:5
|
||||
--> $DIR/eq_op.rs:36:5
|
||||
|
|
||||
LL | 1 - 1;
|
||||
| ^^^^^
|
||||
|
||||
error: equal expressions as operands to `/`
|
||||
--> $DIR/eq_op.rs:35:5
|
||||
--> $DIR/eq_op.rs:37:5
|
||||
|
|
||||
LL | 1 / 1;
|
||||
| ^^^^^
|
||||
|
||||
error: equal expressions as operands to `&&`
|
||||
--> $DIR/eq_op.rs:36:5
|
||||
--> $DIR/eq_op.rs:38:5
|
||||
|
|
||||
LL | true && true;
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `||`
|
||||
--> $DIR/eq_op.rs:38:5
|
||||
--> $DIR/eq_op.rs:40:5
|
||||
|
|
||||
LL | true || true;
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `&&`
|
||||
--> $DIR/eq_op.rs:44:5
|
||||
--> $DIR/eq_op.rs:46:5
|
||||
|
|
||||
LL | a == b && b == a;
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `&&`
|
||||
--> $DIR/eq_op.rs:45:5
|
||||
--> $DIR/eq_op.rs:47:5
|
||||
|
|
||||
LL | a != b && b != a;
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `&&`
|
||||
--> $DIR/eq_op.rs:46:5
|
||||
--> $DIR/eq_op.rs:48:5
|
||||
|
|
||||
LL | a < b && b > a;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `&&`
|
||||
--> $DIR/eq_op.rs:47:5
|
||||
--> $DIR/eq_op.rs:49:5
|
||||
|
|
||||
LL | a <= b && b >= a;
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: equal expressions as operands to `==`
|
||||
--> $DIR/eq_op.rs:50:5
|
||||
--> $DIR/eq_op.rs:52:5
|
||||
|
|
||||
LL | a == a;
|
||||
| ^^^^^^
|
||||
|
||||
error: equal expressions as operands to `/`
|
||||
--> $DIR/eq_op.rs:60:20
|
||||
--> $DIR/eq_op.rs:62:20
|
||||
|
|
||||
LL | const D: u32 = A / A;
|
||||
| ^^^^^
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// does not test any rustfixable lints
|
||||
|
||||
#![warn(clippy::float_cmp_const)]
|
||||
#![allow(clippy::float_cmp)]
|
||||
#![allow(unused, clippy::no_effect, clippy::unnecessary_operation)]
|
||||
|
|
|
@ -1,84 +1,84 @@
|
|||
error: strict comparison of f32 or f64 constant
|
||||
--> $DIR/float_cmp_const.rs:18:5
|
||||
--> $DIR/float_cmp_const.rs:20:5
|
||||
|
|
||||
LL | 1f32 == ONE;
|
||||
| ^^^^^^^^^^^ help: consider comparing them within some error: `(1f32 - ONE).abs() < error`
|
||||
|
|
||||
= note: `-D clippy::float-cmp-const` implied by `-D warnings`
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp_const.rs:18:5
|
||||
--> $DIR/float_cmp_const.rs:20:5
|
||||
|
|
||||
LL | 1f32 == ONE;
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: strict comparison of f32 or f64 constant
|
||||
--> $DIR/float_cmp_const.rs:19:5
|
||||
--> $DIR/float_cmp_const.rs:21:5
|
||||
|
|
||||
LL | TWO == ONE;
|
||||
| ^^^^^^^^^^ help: consider comparing them within some error: `(TWO - ONE).abs() < error`
|
||||
|
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp_const.rs:19:5
|
||||
--> $DIR/float_cmp_const.rs:21:5
|
||||
|
|
||||
LL | TWO == ONE;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: strict comparison of f32 or f64 constant
|
||||
--> $DIR/float_cmp_const.rs:20:5
|
||||
--> $DIR/float_cmp_const.rs:22:5
|
||||
|
|
||||
LL | TWO != ONE;
|
||||
| ^^^^^^^^^^ help: consider comparing them within some error: `(TWO - ONE).abs() > error`
|
||||
|
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp_const.rs:20:5
|
||||
--> $DIR/float_cmp_const.rs:22:5
|
||||
|
|
||||
LL | TWO != ONE;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: strict comparison of f32 or f64 constant
|
||||
--> $DIR/float_cmp_const.rs:21:5
|
||||
--> $DIR/float_cmp_const.rs:23:5
|
||||
|
|
||||
LL | ONE + ONE == TWO;
|
||||
| ^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(ONE + ONE - TWO).abs() < error`
|
||||
|
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp_const.rs:21:5
|
||||
--> $DIR/float_cmp_const.rs:23:5
|
||||
|
|
||||
LL | ONE + ONE == TWO;
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: strict comparison of f32 or f64 constant
|
||||
--> $DIR/float_cmp_const.rs:23:5
|
||||
--> $DIR/float_cmp_const.rs:25:5
|
||||
|
|
||||
LL | x as f32 == ONE;
|
||||
| ^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(x as f32 - ONE).abs() < error`
|
||||
|
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp_const.rs:23:5
|
||||
--> $DIR/float_cmp_const.rs:25:5
|
||||
|
|
||||
LL | x as f32 == ONE;
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: strict comparison of f32 or f64 constant
|
||||
--> $DIR/float_cmp_const.rs:26:5
|
||||
--> $DIR/float_cmp_const.rs:28:5
|
||||
|
|
||||
LL | v == ONE;
|
||||
| ^^^^^^^^ help: consider comparing them within some error: `(v - ONE).abs() < error`
|
||||
|
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp_const.rs:26:5
|
||||
--> $DIR/float_cmp_const.rs:28:5
|
||||
|
|
||||
LL | v == ONE;
|
||||
| ^^^^^^^^
|
||||
|
||||
error: strict comparison of f32 or f64 constant
|
||||
--> $DIR/float_cmp_const.rs:27:5
|
||||
--> $DIR/float_cmp_const.rs:29:5
|
||||
|
|
||||
LL | v != ONE;
|
||||
| ^^^^^^^^ help: consider comparing them within some error: `(v - ONE).abs() > error`
|
||||
|
|
||||
note: std::f32::EPSILON and std::f64::EPSILON are available.
|
||||
--> $DIR/float_cmp_const.rs:27:5
|
||||
--> $DIR/float_cmp_const.rs:29:5
|
||||
|
|
||||
LL | v != ONE;
|
||||
| ^^^^^^^^
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// tests no rustfixable lints
|
||||
// does not test any rustfixable lints
|
||||
|
||||
#![warn(clippy::mixed_case_hex_literals)]
|
||||
#![warn(clippy::zero_prefixed_literal)]
|
||||
|
|
Loading…
Reference in a new issue