diff options
| author | Trevor Gross <tmgross@umich.edu> | 2025-07-30 09:45:53 -0500 |
|---|---|---|
| committer | Trevor Gross <tmgross@umich.edu> | 2025-07-30 10:02:34 -0500 |
| commit | ecf6d3c6ced41d71a09248fdc679309e39bae318 (patch) | |
| tree | ce3ad0f8611a10d212b16164f93d19f9a6286de7 /library/compiler-builtins/libm/src/math/floor.rs | |
| parent | 3cbd088ee4e453eeab2d3cfae3e047b7e12bece8 (diff) | |
| download | rust-ecf6d3c6ced41d71a09248fdc679309e39bae318.tar.gz rust-ecf6d3c6ced41d71a09248fdc679309e39bae318.zip | |
Simplify the configuration for no-panic
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.
Diffstat (limited to 'library/compiler-builtins/libm/src/math/floor.rs')
| -rw-r--r-- | library/compiler-builtins/libm/src/math/floor.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/compiler-builtins/libm/src/math/floor.rs b/library/compiler-builtins/libm/src/math/floor.rs index 3c5eab101d1..7241c427f64 100644 --- a/library/compiler-builtins/libm/src/math/floor.rs +++ b/library/compiler-builtins/libm/src/math/floor.rs @@ -2,7 +2,7 @@ /// /// Finds the nearest integer less than or equal to `x`. #[cfg(f16_enabled)] -#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] +#[cfg_attr(assert_no_panic, no_panic::no_panic)] pub fn floorf16(x: f16) -> f16 { return super::generic::floor(x); } @@ -10,7 +10,7 @@ pub fn floorf16(x: f16) -> f16 { /// Floor (f64) /// /// Finds the nearest integer less than or equal to `x`. -#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] +#[cfg_attr(assert_no_panic, no_panic::no_panic)] pub fn floor(x: f64) -> f64 { select_implementation! { name: floor, @@ -25,7 +25,7 @@ pub fn floor(x: f64) -> f64 { /// Floor (f32) /// /// Finds the nearest integer less than or equal to `x`. -#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] +#[cfg_attr(assert_no_panic, no_panic::no_panic)] pub fn floorf(x: f32) -> f32 { select_implementation! { name: floorf, @@ -40,7 +40,7 @@ pub fn floorf(x: f32) -> f32 { /// /// Finds the nearest integer less than or equal to `x`. #[cfg(f128_enabled)] -#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] +#[cfg_attr(assert_no_panic, no_panic::no_panic)] pub fn floorf128(x: f128) -> f128 { return super::generic::floor(x); } |
