From a3c4c2ee1d8d94141328d2b955ec7dc4aa67aa54 Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Thu, 8 Dec 2022 00:07:00 +0000 Subject: [PATCH] Fix warning when libcore is compiled with no_fp_fmt_parse --- library/core/src/num/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index b2328b001de..ac7f579ebb5 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -4,12 +4,14 @@ use crate::ascii; use crate::convert::TryInto; -use crate::error::Error; use crate::intrinsics; use crate::mem; use crate::ops::{Add, Mul, Sub}; use crate::str::FromStr; +#[cfg(not(no_fp_fmt_parse))] +use crate::error::Error; + // Used because the `?` operator is not allowed in a const context. macro_rules! try_opt { ($e:expr) => {