mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-24 06:17:12 +00:00
Currently, attributes for `no-panic` are gated behind both the `test` config and `assert_no_panic`, because `no-panic` is a dev dependency (so only available with test configuration). However, we only emit `assert_no_panic` when the test config is also set anyway, so there isn't any need to gate on both. Replace gates on `all(test, assert_no_panic)` with only `assert_no_panic`. This is simpler, and also has the benefit that attempting to check for panics without `--test` errors.
54 lines
1.4 KiB
Rust
54 lines
1.4 KiB
Rust
/// Positive difference (f16)
|
|
///
|
|
/// Determines the positive difference between arguments, returning:
|
|
/// * x - y if x > y, or
|
|
/// * +0 if x <= y, or
|
|
/// * NAN if either argument is NAN.
|
|
///
|
|
/// A range error may occur.
|
|
#[cfg(f16_enabled)]
|
|
#[cfg_attr(assert_no_panic, no_panic::no_panic)]
|
|
pub fn fdimf16(x: f16, y: f16) -> f16 {
|
|
super::generic::fdim(x, y)
|
|
}
|
|
|
|
/// Positive difference (f32)
|
|
///
|
|
/// Determines the positive difference between arguments, returning:
|
|
/// * x - y if x > y, or
|
|
/// * +0 if x <= y, or
|
|
/// * NAN if either argument is NAN.
|
|
///
|
|
/// A range error may occur.
|
|
#[cfg_attr(assert_no_panic, no_panic::no_panic)]
|
|
pub fn fdimf(x: f32, y: f32) -> f32 {
|
|
super::generic::fdim(x, y)
|
|
}
|
|
|
|
/// Positive difference (f64)
|
|
///
|
|
/// Determines the positive difference between arguments, returning:
|
|
/// * x - y if x > y, or
|
|
/// * +0 if x <= y, or
|
|
/// * NAN if either argument is NAN.
|
|
///
|
|
/// A range error may occur.
|
|
#[cfg_attr(assert_no_panic, no_panic::no_panic)]
|
|
pub fn fdim(x: f64, y: f64) -> f64 {
|
|
super::generic::fdim(x, y)
|
|
}
|
|
|
|
/// Positive difference (f128)
|
|
///
|
|
/// Determines the positive difference between arguments, returning:
|
|
/// * x - y if x > y, or
|
|
/// * +0 if x <= y, or
|
|
/// * NAN if either argument is NAN.
|
|
///
|
|
/// A range error may occur.
|
|
#[cfg(f128_enabled)]
|
|
#[cfg_attr(assert_no_panic, no_panic::no_panic)]
|
|
pub fn fdimf128(x: f128, y: f128) -> f128 {
|
|
super::generic::fdim(x, y)
|
|
}
|