Skip to content

Commit 24d868f

Browse files
committed
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
1 parent 4c894ea commit 24d868f

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

src/lexical/num.rs

-4
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ pub trait Float: Number {
206206

207207
// MASKS
208208

209-
/// Bitmask for the sign bit.
210-
const SIGN_MASK: Self::Unsigned;
211209
/// Bitmask for the exponent, including the hidden bit.
212210
const EXPONENT_MASK: Self::Unsigned;
213211
/// Bitmask for the hidden bit in exponent, which is an implicit 1 in the fraction.
@@ -313,7 +311,6 @@ impl Float for f32 {
313311

314312
const ZERO: f32 = 0.0;
315313
const MAX_DIGITS: usize = 114;
316-
const SIGN_MASK: u32 = 0x80000000;
317314
const EXPONENT_MASK: u32 = 0x7F800000;
318315
const HIDDEN_BIT_MASK: u32 = 0x00800000;
319316
const MANTISSA_MASK: u32 = 0x007FFFFF;
@@ -371,7 +368,6 @@ impl Float for f64 {
371368

372369
const ZERO: f64 = 0.0;
373370
const MAX_DIGITS: usize = 769;
374-
const SIGN_MASK: u64 = 0x8000000000000000;
375371
const EXPONENT_MASK: u64 = 0x7FF0000000000000;
376372
const HIDDEN_BIT_MASK: u64 = 0x0010000000000000;
377373
const MANTISSA_MASK: u64 = 0x000FFFFFFFFFFFFF;

tests/lexical/num.rs

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ fn check_float<T: Float>(x: T) {
6363
assert!(T::from_bits(x.to_bits()) == x);
6464

6565
// Check properties
66-
let _ = x.to_bits() & T::SIGN_MASK;
6766
let _ = x.to_bits() & T::EXPONENT_MASK;
6867
let _ = x.to_bits() & T::HIDDEN_BIT_MASK;
6968
let _ = x.to_bits() & T::MANTISSA_MASK;

0 commit comments

Comments
 (0)