Skip to content

Commit f08db6b

Browse files
committed
Add must_use on copysign
Added a #[must_use] annotation on copysign, per review feedback.
1 parent 9a2e702 commit f08db6b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/libstd/f32.rs

+1
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ impl f32 {
221221
/// assert!(f32::NAN.copysign(1.0).is_nan());
222222
/// ```
223223
#[inline]
224+
#[must_use]
224225
#[unstable(feature="copysign", issue="55169")]
225226
pub fn copysign(self, y: f32) -> f32 {
226227
unsafe { intrinsics::copysignf32(self, y) }

src/libstd/f64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ impl f64 {
199199
/// assert!(f64::NAN.copysign(1.0).is_nan());
200200
/// ```
201201
#[inline]
202+
#[must_use]
202203
#[unstable(feature="copysign", issue="55169")]
203204
pub fn copysign(self, y: f64) -> f64 {
204205
unsafe { intrinsics::copysignf64(self, y) }

0 commit comments

Comments
 (0)