Skip fast path for dec2flt when optimize_for_size · model-checking/verify-rust-std@019e01f (original) (raw)
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -250,8 +250,10 @@ pub fn dec2flt<F: RawFloat>(s: &str) -> Result<F, ParseFloatError> { | ||
| 250 | 250 | None => return Err(pfe_invalid()), |
| 251 | 251 | }; |
| 252 | 252 | num.negative = negative; |
| 253 | -if let Some(value) = num.try_fast_path::<F>() { | |
| 254 | -return Ok(value); | |
| 253 | +if cfg!(not(feature = "optimize_for_size")) { | |
| 254 | +if let Some(value) = num.try_fast_path::<F>() { | |
| 255 | +return Ok(value); | |
| 256 | +} | |
| 255 | 257 | } |
| 256 | 258 | |
| 257 | 259 | // If significant digits were truncated, then we can have rounding error |