From c4391b326edbf4bcf374c9891fb0bfc2bc33531a Mon Sep 17 00:00:00 2001 From: Dion Dokter Date: Tue, 11 Jun 2024 13:24:35 +0200 Subject: [PATCH] Skip fast path for dec2flt when optimize_for_size --- library/core/src/num/dec2flt/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs index a4bc8b1c9b0..c10bf797b57 100644 --- a/library/core/src/num/dec2flt/mod.rs +++ b/library/core/src/num/dec2flt/mod.rs @@ -250,8 +250,10 @@ pub fn dec2flt(s: &str) -> Result { None => return Err(pfe_invalid()), }; num.negative = negative; - if let Some(value) = num.try_fast_path::() { - return Ok(value); + if cfg!(not(feature = "optimize_for_size")) { + if let Some(value) = num.try_fast_path::() { + return Ok(value); + } } // If significant digits were truncated, then we can have rounding error