Another lexical const that is unused, though not in test

warning: associated constant `SIGN_MASK` is never used
       --> src/lexical/num.rs:210:11
        |
    175 | pub trait Float: Number {
        |           ----- associated constant in this trait
    ...
    210 |     const SIGN_MASK: Self::Unsigned;
        |           ^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default
This commit is contained in:
David Tolnay 2024-06-07 20:23:56 -07:00
parent 4c894eaa18
commit 24d868f4e9
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 0 additions and 5 deletions

View File

@ -206,8 +206,6 @@ pub trait Float: Number {
// MASKS
/// Bitmask for the sign bit.
const SIGN_MASK: Self::Unsigned;
/// Bitmask for the exponent, including the hidden bit.
const EXPONENT_MASK: Self::Unsigned;
/// Bitmask for the hidden bit in exponent, which is an implicit 1 in the fraction.
@ -313,7 +311,6 @@ impl Float for f32 {
const ZERO: f32 = 0.0;
const MAX_DIGITS: usize = 114;
const SIGN_MASK: u32 = 0x80000000;
const EXPONENT_MASK: u32 = 0x7F800000;
const HIDDEN_BIT_MASK: u32 = 0x00800000;
const MANTISSA_MASK: u32 = 0x007FFFFF;
@ -371,7 +368,6 @@ impl Float for f64 {
const ZERO: f64 = 0.0;
const MAX_DIGITS: usize = 769;
const SIGN_MASK: u64 = 0x8000000000000000;
const EXPONENT_MASK: u64 = 0x7FF0000000000000;
const HIDDEN_BIT_MASK: u64 = 0x0010000000000000;
const MANTISSA_MASK: u64 = 0x000FFFFFFFFFFFFF;

View File

@ -63,7 +63,6 @@ fn check_float<T: Float>(x: T) {
assert!(T::from_bits(x.to_bits()) == x);
// Check properties
let _ = x.to_bits() & T::SIGN_MASK;
let _ = x.to_bits() & T::EXPONENT_MASK;
let _ = x.to_bits() & T::HIDDEN_BIT_MASK;
let _ = x.to_bits() & T::MANTISSA_MASK;