From ceea85a148ec3426edfc00b8353a19c1d2df5dbf Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Wed, 8 Jan 2014 22:57:31 +1100 Subject: Remove ApproxEq and assert_approx_eq! This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases. --- src/libsyntax/ext/expand.rs | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index fb98f766fef..5d497dd541f 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -741,43 +741,6 @@ pub fn std_macros() -> @str { ) ) - macro_rules! assert_approx_eq ( - ($given:expr , $expected:expr) => ( - { - use std::cmp::ApproxEq; - - let given_val = $given; - let expected_val = $expected; - // check both directions of equality.... - if !( - given_val.approx_eq(&expected_val) && - expected_val.approx_eq(&given_val) - ) { - fail!("left: {:?} does not approximately equal right: {:?}", - given_val, expected_val); - } - } - ); - ($given:expr , $expected:expr , $epsilon:expr) => ( - { - use std::cmp::ApproxEq; - - let given_val = $given; - let expected_val = $expected; - let epsilon_val = $epsilon; - // check both directions of equality.... - if !( - given_val.approx_eq_eps(&expected_val, &epsilon_val) && - expected_val.approx_eq_eps(&given_val, &epsilon_val) - ) { - fail!("left: {:?} does not approximately equal right: \ - {:?} with epsilon: {:?}", - given_val, expected_val, epsilon_val); - } - } - ) - ) - /// A utility macro for indicating unreachable code. It will fail if /// executed. This is occasionally useful to put after loops that never /// terminate normally, but instead directly return from a function. -- cgit 1.4.1-3-g733a5