about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-22 03:50:02 +0000
committerbors <bors@rust-lang.org>2020-04-22 03:50:02 +0000
commit2dc5b602eee35d70e8e6e506a7ea07b6c7e0197d (patch)
tree43279f0eee2bf88591559449b56f87b217873337 /src/libstd
parent70f4f320b02cfd511c78389a6db1628285277410 (diff)
parent66eaead0e2088e5bad6e5c24287a5f061aab4844 (diff)
downloadrust-2dc5b602eee35d70e8e6e506a7ea07b6c7e0197d.tar.gz
rust-2dc5b602eee35d70e8e6e506a7ea07b6c7e0197d.zip
Auto merge of #71410 - JohnTitor:rollup-vh6dut5, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #70998 (Suggest `-> impl Trait` and `-> Box<dyn Trait>` on fn that doesn't return)
 - #71236 (Remove unused rustc_serialize::hex module)
 - #71366 (Use assoc int consts3)
 - #71372 (Fix #! (shebang) stripping account space issue)
 - #71384 (Fix stage0.txt version number comment)
 - #71390 (Fix incorrect description of E0690)
 - #71399 (Clean up E0554 explanation)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/f32.rs8
-rw-r--r--src/libstd/f64.rs14
-rw-r--r--src/libstd/thread/mod.rs2
3 files changed, 12 insertions, 12 deletions
diff --git a/src/libstd/f32.rs b/src/libstd/f32.rs
index 65273275a40..8e743ace99b 100644
--- a/src/libstd/f32.rs
+++ b/src/libstd/f32.rs
@@ -171,7 +171,7 @@ impl f32 {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn signum(self) -> f32 {
-        if self.is_nan() { NAN } else { 1.0_f32.copysign(self) }
+        if self.is_nan() { Self::NAN } else { 1.0_f32.copysign(self) }
     }
 
     /// Returns a number composed of the magnitude of `self` and the sign of
@@ -832,8 +832,8 @@ impl f32 {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn asinh(self) -> f32 {
-        if self == NEG_INFINITY {
-            NEG_INFINITY
+        if self == Self::NEG_INFINITY {
+            Self::NEG_INFINITY
         } else {
             (self + ((self * self) + 1.0).sqrt()).ln().copysign(self)
         }
@@ -855,7 +855,7 @@ impl f32 {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn acosh(self) -> f32 {
-        if self < 1.0 { crate::f32::NAN } else { (self + ((self * self) - 1.0).sqrt()).ln() }
+        if self < 1.0 { Self::NAN } else { (self + ((self * self) - 1.0).sqrt()).ln() }
     }
 
     /// Inverse hyperbolic tangent function.
diff --git a/src/libstd/f64.rs b/src/libstd/f64.rs
index 5cf9cb73d4b..fe64d27b1ef 100644
--- a/src/libstd/f64.rs
+++ b/src/libstd/f64.rs
@@ -171,7 +171,7 @@ impl f64 {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn signum(self) -> f64 {
-        if self.is_nan() { NAN } else { 1.0_f64.copysign(self) }
+        if self.is_nan() { Self::NAN } else { 1.0_f64.copysign(self) }
     }
 
     /// Returns a number composed of the magnitude of `self` and the sign of
@@ -834,8 +834,8 @@ impl f64 {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn asinh(self) -> f64 {
-        if self == NEG_INFINITY {
-            NEG_INFINITY
+        if self == Self::NEG_INFINITY {
+            Self::NEG_INFINITY
         } else {
             (self + ((self * self) + 1.0).sqrt()).ln().copysign(self)
         }
@@ -857,7 +857,7 @@ impl f64 {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
     pub fn acosh(self) -> f64 {
-        if self < 1.0 { NAN } else { (self + ((self * self) - 1.0).sqrt()).ln() }
+        if self < 1.0 { Self::NAN } else { (self + ((self * self) - 1.0).sqrt()).ln() }
     }
 
     /// Inverse hyperbolic tangent function.
@@ -926,16 +926,16 @@ impl f64 {
                 if self > 0.0 {
                     log_fn(self)
                 } else if self == 0.0 {
-                    NEG_INFINITY // log(0) = -Inf
+                    Self::NEG_INFINITY // log(0) = -Inf
                 } else {
-                    NAN // log(-n) = NaN
+                    Self::NAN // log(-n) = NaN
                 }
             } else if self.is_nan() {
                 self // log(NaN) = NaN
             } else if self > 0.0 {
                 self // log(Inf) = Inf
             } else {
-                NAN // log(-Inf) = NaN
+                Self::NAN // log(-Inf) = NaN
             }
         }
     }
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index 282e268efd2..7a3cbbe4562 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -1062,7 +1062,7 @@ impl ThreadId {
 
             // If we somehow use up all our bits, panic so that we're not
             // covering up subtle bugs of IDs being reused.
-            if COUNTER == crate::u64::MAX {
+            if COUNTER == u64::MAX {
                 panic!("failed to generate unique thread ID: bitspace exhausted");
             }