Skip to content

Commit 221a0a0

Browse files
committed
Make assert_biteq! not rely on having Int in scope
1 parent 47799f8 commit 221a0a0

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

libm/src/math/generic/fmax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn fmax<F: Float>(x: F, y: F) -> F {
2626
#[cfg(test)]
2727
mod tests {
2828
use super::*;
29-
use crate::support::{Hexf, Int};
29+
use crate::support::Hexf;
3030

3131
fn spec_test<F: Float>() {
3232
let cases = [

libm/src/math/generic/fmaximum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn fmaximum<F: Float>(x: F, y: F) -> F {
2929
#[cfg(test)]
3030
mod tests {
3131
use super::*;
32-
use crate::support::{Hexf, Int};
32+
use crate::support::Hexf;
3333

3434
fn spec_test<F: Float>() {
3535
let cases = [

libm/src/math/generic/fmaximum_num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn fmaximum_num<F: Float>(x: F, y: F) -> F {
2828
#[cfg(test)]
2929
mod tests {
3030
use super::*;
31-
use crate::support::{Hexf, Int};
31+
use crate::support::Hexf;
3232

3333
fn spec_test<F: Float>() {
3434
let cases = [

libm/src/math/generic/fmin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn fmin<F: Float>(x: F, y: F) -> F {
2525
#[cfg(test)]
2626
mod tests {
2727
use super::*;
28-
use crate::support::{Hexf, Int};
28+
use crate::support::Hexf;
2929

3030
fn spec_test<F: Float>() {
3131
let cases = [

libm/src/math/generic/fminimum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn fminimum<F: Float>(x: F, y: F) -> F {
2929
#[cfg(test)]
3030
mod tests {
3131
use super::*;
32-
use crate::support::{Hexf, Int};
32+
use crate::support::Hexf;
3333

3434
fn spec_test<F: Float>() {
3535
let cases = [

libm/src/math/generic/fminimum_num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn fminimum_num<F: Float>(x: F, y: F) -> F {
2828
#[cfg(test)]
2929
mod tests {
3030
use super::*;
31-
use crate::support::{Hexf, Int};
31+
use crate::support::Hexf;
3232

3333
fn spec_test<F: Float>() {
3434
let cases = [

libm/src/math/generic/rint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn rint_round<F: Float>(x: F, _round: Round) -> FpResult<F> {
4343
#[cfg(test)]
4444
mod tests {
4545
use super::*;
46-
use crate::support::{Hexf, Int, Status};
46+
use crate::support::{Hexf, Status};
4747

4848
fn spec_test<F: Float>(cases: &[(F, F, Status)]) {
4949
let roundtrip = [F::ZERO, F::ONE, F::NEG_ONE, F::NEG_ZERO, F::INFINITY, F::NEG_INFINITY];

libm/src/math/generic/scalbn.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ where
121121

122122
#[cfg(test)]
123123
mod tests {
124-
use super::super::super::Int;
125124
use super::*;
126125

127126
// Tests against N3220

libm/src/math/support/macros.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ macro_rules! hf128 {
137137
#[cfg(test)]
138138
macro_rules! assert_biteq {
139139
($left:expr, $right:expr, $($tt:tt)*) => {{
140+
use $crate::support::Int;
140141
let l = $left;
141142
let r = $right;
142-
let bits = (l.to_bits() - l.to_bits()).leading_zeros(); // hack to get the width from the value
143+
let bits = Int::leading_zeros(l.to_bits() - l.to_bits()); // hack to get the width from the value
143144
assert!(
144145
l.biteq(r),
145146
"{}\nl: {l:?} ({lb:#0width$x})\nr: {r:?} ({rb:#0width$x})",

0 commit comments

Comments
 (0)