about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorRaph Levien <raph.levien@gmail.com>2018-10-18 08:35:09 -0700
committerRaph Levien <raph.levien@gmail.com>2018-10-18 08:35:09 -0700
commitf08db6bf1ee44dd1bc8c4d3ddcea1425fcd8d118 (patch)
tree45e9859e0466fe65fecadf512c7185d1508515cb /src/libstd
parent9a2e7026dcbd84641b05334b5b4b0a4d647944f4 (diff)
downloadrust-f08db6bf1ee44dd1bc8c4d3ddcea1425fcd8d118.tar.gz
rust-f08db6bf1ee44dd1bc8c4d3ddcea1425fcd8d118.zip
Add must_use on copysign
Added a #[must_use] annotation on copysign, per review feedback.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/f32.rs1
-rw-r--r--src/libstd/f64.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/f32.rs b/src/libstd/f32.rs
index 369745d8189..c3f225d1eb0 100644
--- a/src/libstd/f32.rs
+++ b/src/libstd/f32.rs
@@ -221,6 +221,7 @@ impl f32 {
     /// assert!(f32::NAN.copysign(1.0).is_nan());
     /// ```
     #[inline]
+    #[must_use]
     #[unstable(feature="copysign", issue="55169")]
     pub fn copysign(self, y: f32) -> f32 {
         unsafe { intrinsics::copysignf32(self, y) }
diff --git a/src/libstd/f64.rs b/src/libstd/f64.rs
index df23d62ecfd..da062dda77a 100644
--- a/src/libstd/f64.rs
+++ b/src/libstd/f64.rs
@@ -199,6 +199,7 @@ impl f64 {
     /// assert!(f64::NAN.copysign(1.0).is_nan());
     /// ```
     #[inline]
+    #[must_use]
     #[unstable(feature="copysign", issue="55169")]
     pub fn copysign(self, y: f64) -> f64 {
         unsafe { intrinsics::copysignf64(self, y) }