Repository: mongodb/bson-rust (language: rust)

Issue:
bson 0.15 build error!!! 



Discussion / hints:
+1 bson 0.15 error in windows x64 platform 
+1 for this on macOS Catalina with rustc 1.41.0:

```
error[E0599]: no associated item named `INFINITY` found for type `f64` in the current scope
   --> /Users/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/bson-0.15.0/src/bson.rs:639:60
    |
639 |                 Ok("Infinity") => return Bson::Double(f64::INFINITY),
    |                                                            ^^^^^^^^ associated item not found in `f64`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use core::num::dec2flt::rawfp::RawFloat;`
help: you are looking for the module in `std`, not the primitive type
    |
639 |                 Ok("Infinity") => return Bson::Double(std::f64::INFINITY),
    |                                                       ^^^^^^^^^^^^^^^^^^
```

Fix patch:
diff --git a/src/bson.rs b/src/bson.rs
index 8073b84f..5d6cc8b6 100644
--- a/src/bson.rs
+++ b/src/bson.rs
@@ -636,9 +636,9 @@ impl Bson {
             }
 
             ["$numberDouble"] => match doc.get_str("$numberDouble") {
-                Ok("Infinity") => return Bson::Double(f64::INFINITY),
-                Ok("-Infinity") => return Bson::Double(f64::NEG_INFINITY),
-                Ok("NaN") => return Bson::Double(f64::NAN),
+                Ok("Infinity") => return Bson::Double(std::f64::INFINITY),
+                Ok("-Infinity") => return Bson::Double(std::f64::NEG_INFINITY),
+                Ok("NaN") => return Bson::Double(std::f64::NAN),
                 Ok(other) => {
                     if let Ok(d) = other.parse() {
                         return Bson::Double(d);
@@ -692,7 +692,10 @@ impl Bson {
 
                     if let Ok(t) = timestamp.get_i64("t") {
                         if let Ok(i) = timestamp.get_i64("i") {
-                            if t >= 0 && i >= 0 && t <= (u32::MAX as i64) && i <= (u32::MAX as i64)
+                            if t >= 0
+                                && i >= 0
+                                && t <= (std::u32::MAX as i64)
+                                && i <= (std::u32::MAX as i64)
                             {
                                 return Bson::Timestamp(Timestamp {
                                     time: t as u32,
diff --git a/src/extjson/de.rs b/src/extjson/de.rs
index 2cd471fc..a9c6f415 100644
--- a/src/extjson/de.rs
+++ b/src/extjson/de.rs
@@ -185,7 +185,7 @@ impl TryFrom<serde_json::Value> for Bson {
             serde_json::Value::Number(x) => x
                 .as_i64()
                 .map(|i| {
-                    if i >= i32::MIN as i64 && i <= i32::MAX as i64 {
+                    if i >= std::i32::MIN as i64 && i <= std::i32::MAX as i64 {
                         Bson::Int32(i as i32)
                     } else {
                         Bson::Int64(i)
diff --git a/src/extjson/models.rs b/src/extjson/models.rs
index f0626e4b..0129aedf 100644
--- a/src/extjson/models.rs
+++ b/src/extjson/models.rs
@@ -56,9 +56,9 @@ pub(crate) struct Double {
 impl Double {
     pub(crate) fn parse(self) -> extjson::de::Result<f64> {
         match self.value.as_str() {
-            "Infinity" => Ok(f64::INFINITY),
-            "-Infinity" => Ok(f64::NEG_INFINITY),
-            "NaN" => Ok(f64::NAN),
+            "Infinity" => Ok(std::f64::INFINITY),
+            "-Infinity" => Ok(std::f64::NEG_INFINITY),
+            "NaN" => Ok(std::f64::NAN),
             other => {
                 let d: f64 = other.parse().map_err(|_| {
                     extjson::de::Error::invalid_value(


Test patch: