From ddaf8580d58b859701a94695368120023ba0ef34 Mon Sep 17 00:00:00 2001 From: clippered Date: Mon, 6 Nov 2017 20:23:18 +1100 Subject: [PATCH] remove duplicate tests with float_cmp --- tests/ui/float_cmp_const.rs | 10 ++----- tests/ui/float_cmp_const.stderr | 49 --------------------------------- 2 files changed, 3 insertions(+), 56 deletions(-) diff --git a/tests/ui/float_cmp_const.rs b/tests/ui/float_cmp_const.rs index fe69eeeed..990a83730 100644 --- a/tests/ui/float_cmp_const.rs +++ b/tests/ui/float_cmp_const.rs @@ -29,16 +29,12 @@ fn main() { v <= ONE; v >= ONE; - // has float_cmp warns (as expected), no float constants - let w = 1.1; - v == w; - v != w; - v == 1.0; - v != 1.0; - // no errors, zero and infinity values ONE != 0f32; TWO == 0f32; ONE != ::std::f32::INFINITY; ONE == ::std::f32::NEG_INFINITY; + + // Note: float_cmp will warn as expected on cases where there are no float constants + // e.g. v == 1.0 } diff --git a/tests/ui/float_cmp_const.stderr b/tests/ui/float_cmp_const.stderr index f8933938e..0bdbb6770 100644 --- a/tests/ui/float_cmp_const.stderr +++ b/tests/ui/float_cmp_const.stderr @@ -83,52 +83,3 @@ note: std::f32::EPSILON and std::f64::EPSILON are available. 24 | v != ONE; | ^^^^^^^^ -error: strict comparison of f32 or f64 - --> $DIR/float_cmp_const.rs:34:5 - | -34 | v == w; - | ^^^^^^ help: consider comparing them within some error: `(v - w).abs() < error` - | - = note: `-D float-cmp` implied by `-D warnings` -note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp_const.rs:34:5 - | -34 | v == w; - | ^^^^^^ - -error: strict comparison of f32 or f64 - --> $DIR/float_cmp_const.rs:35:5 - | -35 | v != w; - | ^^^^^^ help: consider comparing them within some error: `(v - w).abs() < error` - | -note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp_const.rs:35:5 - | -35 | v != w; - | ^^^^^^ - -error: strict comparison of f32 or f64 - --> $DIR/float_cmp_const.rs:36:5 - | -36 | v == 1.0; - | ^^^^^^^^ help: consider comparing them within some error: `(v - 1.0).abs() < error` - | -note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp_const.rs:36:5 - | -36 | v == 1.0; - | ^^^^^^^^ - -error: strict comparison of f32 or f64 - --> $DIR/float_cmp_const.rs:37:5 - | -37 | v != 1.0; - | ^^^^^^^^ help: consider comparing them within some error: `(v - 1.0).abs() < error` - | -note: std::f32::EPSILON and std::f64::EPSILON are available. - --> $DIR/float_cmp_const.rs:37:5 - | -37 | v != 1.0; - | ^^^^^^^^ -