mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
add missing safety comments
This commit is contained in:
parent
f512051c0e
commit
b0224fb794
@ -1378,6 +1378,7 @@ impl f128 {
|
||||
#[rustc_const_unstable(feature = "const_float_methods", issue = "130843")]
|
||||
#[must_use = "method returns a new number and does not mutate the original value"]
|
||||
pub const fn copysign(self, sign: f128) -> f128 {
|
||||
// SAFETY: this is actually a safe intrinsic
|
||||
unsafe { intrinsics::copysignf128(self, sign) }
|
||||
}
|
||||
}
|
||||
|
@ -1352,6 +1352,7 @@ impl f16 {
|
||||
#[rustc_const_unstable(feature = "const_float_methods", issue = "130843")]
|
||||
#[must_use = "method returns a new number and does not mutate the original value"]
|
||||
pub const fn copysign(self, sign: f16) -> f16 {
|
||||
// SAFETY: this is actually a safe intrinsic
|
||||
unsafe { intrinsics::copysignf16(self, sign) }
|
||||
}
|
||||
}
|
||||
|
@ -1449,6 +1449,7 @@ impl f32 {
|
||||
#[rustc_const_unstable(feature = "const_float_methods", issue = "130843")]
|
||||
#[inline]
|
||||
pub const fn abs(self) -> f32 {
|
||||
// SAFETY: this is actually a safe intrinsic
|
||||
unsafe { intrinsics::fabsf32(self) }
|
||||
}
|
||||
|
||||
@ -1509,6 +1510,7 @@ impl f32 {
|
||||
#[stable(feature = "copysign", since = "1.35.0")]
|
||||
#[rustc_const_unstable(feature = "const_float_methods", issue = "130843")]
|
||||
pub const fn copysign(self, sign: f32) -> f32 {
|
||||
// SAFETY: this is actually a safe intrinsic
|
||||
unsafe { intrinsics::copysignf32(self, sign) }
|
||||
}
|
||||
}
|
||||
|
@ -1449,6 +1449,7 @@ impl f64 {
|
||||
#[rustc_const_unstable(feature = "const_float_methods", issue = "130843")]
|
||||
#[inline]
|
||||
pub const fn abs(self) -> f64 {
|
||||
// SAFETY: this is actually a safe intrinsic
|
||||
unsafe { intrinsics::fabsf64(self) }
|
||||
}
|
||||
|
||||
@ -1509,6 +1510,7 @@ impl f64 {
|
||||
#[rustc_const_unstable(feature = "const_float_methods", issue = "130843")]
|
||||
#[inline]
|
||||
pub const fn copysign(self, sign: f64) -> f64 {
|
||||
// SAFETY: this is actually a safe intrinsic
|
||||
unsafe { intrinsics::copysignf64(self, sign) }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user