Skip to content

Commit 950099d

Browse files
committed
Import in the macro instead of the test
1 parent a7aea87 commit 950099d

File tree

1 file changed

+3
-1
lines changed
  • library/coretests/tests/floats

1 file changed

+3
-1
lines changed

library/coretests/tests/floats/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::fmt;
2+
use std::num::FpCategory as Fp;
23
use std::ops::{Add, Div, Mul, Rem, Sub};
34

45
/// Set the default tolerance for float comparison based on the type.
@@ -187,6 +188,8 @@ macro_rules! float_test {
187188
mod const_ {
188189
#[allow(unused)]
189190
use super::Approx;
191+
#[allow(unused)]
192+
use std::num::FpCategory as Fp;
190193
// Shadow the runtime versions of the macro with const-compatible versions.
191194
#[allow(unused)]
192195
use $crate::floats::{
@@ -258,7 +261,6 @@ float_test! {
258261
f128: #[cfg(any(miri, target_has_reliable_f128))],
259262
},
260263
test<Float> {
261-
use std::num::FpCategory as Fp;
262264
let nan: Float = Float::NAN;
263265
assert!(nan.is_nan());
264266
assert!(!nan.is_infinite());

0 commit comments

Comments
 (0)