]> git.lizzy.rs Git - rust.git/commitdiff
Fix different NaNs in if const expressions test
authorTaylor Cramer <cramertaylorj@gmail.com>
Wed, 13 Jul 2016 17:02:28 +0000 (10:02 -0700)
committerTaylor Cramer <cramertaylorj@gmail.com>
Wed, 13 Jul 2016 17:02:28 +0000 (10:02 -0700)
tests/compile-fail/copies.rs

index b2b54251799e4d780eddf819c21294dbc7f6f3b8..3c3e43931ed7bf4ccdcc4e7bfea3c991cccf808c 100644 (file)
@@ -9,6 +9,7 @@
 #![allow(cyclomatic_complexity)]
 #![allow(blacklisted_name)]
 #![allow(collapsible_if)]
+#![allow(zero_divided_by_zero, eq_op)]
 
 fn bar<T>(_: T) {}
 fn foo() -> bool { unimplemented!() }
@@ -251,9 +252,9 @@ fn if_same_then_else() -> Result<&'static str, ()> {
 
     // Different NaNs
     let _ = if true {
-        1.0 / 0.0
+        0.0 / 0.0
     } else {
-        (-5f32).sqrt()
+        std::f32::NAN
     };
 
     // Same NaNs