diff --git a/clippy_lints/src/erasing_op.rs b/clippy_lints/src/erasing_op.rs index 7b5b4a3d3afb..dd8f029501f5 100644 --- a/clippy_lints/src/erasing_op.rs +++ b/clippy_lints/src/erasing_op.rs @@ -7,7 +7,8 @@ use utils::{in_macro, span_lint}; /// **What it does:** Checks for erasing operations, e.g. `x * 0`. /// /// **Why is this bad?** The whole expression can be replaced by zero. -/// Most likely mistake was made and code should be reviewed or simplified. +/// This is most likely not the intended outcome and should probably be +/// corrected /// /// **Known problems:** None. /// @@ -55,7 +56,7 @@ fn check(cx: &LateContext, e: &Expr, span: Span) { cx, ERASING_OP, span, - "the operation is ineffective. Consider reducing it to `0`", + "this operation will always return zero. This is likely not the intended outcome", ); } } diff --git a/tests/ui/bit_masks.stderr b/tests/ui/bit_masks.stderr index 45b8bbe6d9e4..39320bb9c30b 100644 --- a/tests/ui/bit_masks.stderr +++ b/tests/ui/bit_masks.stderr @@ -6,7 +6,7 @@ error: &-masking with zero | = note: `-D bad-bit-mask` implied by `-D warnings` -error: the operation is ineffective. Consider reducing it to `0` +error: this operation will always return zero. This is likely not the intended outcome --> $DIR/bit_masks.rs:12:5 | 12 | x & 0 == 0; @@ -56,7 +56,7 @@ error: &-masking with zero 35 | 0 & x == 0; | ^^^^^^^^^^ -error: the operation is ineffective. Consider reducing it to `0` +error: this operation will always return zero. This is likely not the intended outcome --> $DIR/bit_masks.rs:35:5 | 35 | 0 & x == 0; diff --git a/tests/ui/erasing_op.stderr b/tests/ui/erasing_op.stderr index 496c297ef2b4..8a05d2c251d1 100644 --- a/tests/ui/erasing_op.stderr +++ b/tests/ui/erasing_op.stderr @@ -1,4 +1,4 @@ -error: the operation is ineffective. Consider reducing it to `0` +error: this operation will always return zero. This is likely not the intended outcome --> $DIR/erasing_op.rs:9:5 | 9 | x * 0; @@ -6,13 +6,13 @@ error: the operation is ineffective. Consider reducing it to `0` | = note: `-D erasing-op` implied by `-D warnings` -error: the operation is ineffective. Consider reducing it to `0` +error: this operation will always return zero. This is likely not the intended outcome --> $DIR/erasing_op.rs:10:5 | 10 | 0 & x; | ^^^^^ -error: the operation is ineffective. Consider reducing it to `0` +error: this operation will always return zero. This is likely not the intended outcome --> $DIR/erasing_op.rs:11:5 | 11 | 0 / x;