about summary refs log tree commit diff
path: root/library/compiler-builtins
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-07-17 03:58:43 -0500
committerTrevor Gross <tmgross@umich.edu>2025-07-17 03:59:25 -0500
commit5157aa1a0f4d9a7a5f90bff59a7f9f7ca39ca1e9 (patch)
treea3e6756ab875298af31bb3209196474ffee6f1da /library/compiler-builtins
parent93e0074aca1601132a12f7bb143e42824e21e1ce (diff)
downloadrust-5157aa1a0f4d9a7a5f90bff59a7f9f7ca39ca1e9.tar.gz
rust-5157aa1a0f4d9a7a5f90bff59a7f9f7ca39ca1e9.zip
Allow a new lint failure in nightly
```text
warning: function `f32_to_bits` is never used
   --> libm/src/math/support/float_traits.rs:367:14
    |
367 | pub const fn f32_to_bits(x: f32) -> u32 {
    |              ^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: function `f64_to_bits` is never used
   --> libm/src/math/support/float_traits.rs:381:14
    |
381 | pub const fn f64_to_bits(x: f64) -> u64 {
    |              ^^^^^^^^^^^

warning: `libm` (lib) generated 2 warnings
```

This is a false positive, see RUST-144060.
Diffstat (limited to 'library/compiler-builtins')
-rw-r--r--library/compiler-builtins/libm/src/math/support/float_traits.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/compiler-builtins/libm/src/math/support/float_traits.rs b/library/compiler-builtins/libm/src/math/support/float_traits.rs
index c3e7eeec245..fb790e69615 100644
--- a/library/compiler-builtins/libm/src/math/support/float_traits.rs
+++ b/library/compiler-builtins/libm/src/math/support/float_traits.rs
@@ -363,6 +363,7 @@ pub const fn f32_from_bits(bits: u32) -> f32 {
 }
 
 /// `f32::to_bits`
+#[allow(dead_code)] // workaround for false positive RUST-144060
 #[allow(unnecessary_transmutes)] // lint appears in newer versions of Rust
 pub const fn f32_to_bits(x: f32) -> u32 {
     // SAFETY: POD cast with no preconditions
@@ -377,6 +378,7 @@ pub const fn f64_from_bits(bits: u64) -> f64 {
 }
 
 /// `f64::to_bits`
+#[allow(dead_code)] // workaround for false positive RUST-144060
 #[allow(unnecessary_transmutes)] // lint appears in newer versions of Rust
 pub const fn f64_to_bits(x: f64) -> u64 {
     // SAFETY: POD cast with no preconditions