From f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Tue, 9 Jul 2024 22:30:26 +0000 Subject: Show diff suggestion format on verbose replacement ``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ``` --- .../clippy/tests/ui/manual_float_methods.stderr | 45 +++++++++++++--------- 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'src/tools/clippy/tests/ui/manual_float_methods.stderr') diff --git a/src/tools/clippy/tests/ui/manual_float_methods.stderr b/src/tools/clippy/tests/ui/manual_float_methods.stderr index 676a4485ab4..1352c5e73ca 100644 --- a/src/tools/clippy/tests/ui/manual_float_methods.stderr +++ b/src/tools/clippy/tests/ui/manual_float_methods.stderr @@ -17,16 +17,19 @@ LL | if x != f32::INFINITY && x != f32::NEG_INFINITY {} = help: to override `-D warnings` add `#[allow(clippy::manual_is_finite)]` help: use the dedicated method instead | -LL | if x.is_finite() {} - | ~~~~~~~~~~~~~ +LL - if x != f32::INFINITY && x != f32::NEG_INFINITY {} +LL + if x.is_finite() {} + | help: this will alter how it handles NaN; if that is a problem, use instead | -LL | if x.is_finite() || x.is_nan() {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if x != f32::INFINITY && x != f32::NEG_INFINITY {} +LL + if x.is_finite() || x.is_nan() {} + | help: or, for conciseness | -LL | if !x.is_infinite() {} - | ~~~~~~~~~~~~~~~~ +LL - if x != f32::INFINITY && x != f32::NEG_INFINITY {} +LL + if !x.is_infinite() {} + | error: manually checking if a float is infinite --> tests/ui/manual_float_methods.rs:26:8 @@ -42,16 +45,19 @@ LL | if x != INFINITE && x != NEG_INFINITE {} | help: use the dedicated method instead | -LL | if x.is_finite() {} - | ~~~~~~~~~~~~~ +LL - if x != INFINITE && x != NEG_INFINITE {} +LL + if x.is_finite() {} + | help: this will alter how it handles NaN; if that is a problem, use instead | -LL | if x.is_finite() || x.is_nan() {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if x != INFINITE && x != NEG_INFINITE {} +LL + if x.is_finite() || x.is_nan() {} + | help: or, for conciseness | -LL | if !x.is_infinite() {} - | ~~~~~~~~~~~~~~~~ +LL - if x != INFINITE && x != NEG_INFINITE {} +LL + if !x.is_infinite() {} + | error: manually checking if a float is infinite --> tests/ui/manual_float_methods.rs:29:8 @@ -67,16 +73,19 @@ LL | if x != f64::INFINITY && x != f64::NEG_INFINITY {} | help: use the dedicated method instead | -LL | if x.is_finite() {} - | ~~~~~~~~~~~~~ +LL - if x != f64::INFINITY && x != f64::NEG_INFINITY {} +LL + if x.is_finite() {} + | help: this will alter how it handles NaN; if that is a problem, use instead | -LL | if x.is_finite() || x.is_nan() {} - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL - if x != f64::INFINITY && x != f64::NEG_INFINITY {} +LL + if x.is_finite() || x.is_nan() {} + | help: or, for conciseness | -LL | if !x.is_infinite() {} - | ~~~~~~~~~~~~~~~~ +LL - if x != f64::INFINITY && x != f64::NEG_INFINITY {} +LL + if !x.is_infinite() {} + | error: manually checking if a float is infinite --> tests/ui/manual_float_methods.rs:44:12 -- cgit 1.4.1-3-g733a5