diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-07-22 15:32:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-22 15:32:12 +0200 |
| commit | 1d7faafe47a3d34ef854609e7b4a5e48cc66e7a9 (patch) | |
| tree | a3689c79a5f230b64cb6a34dd5b99e72122458b6 /src/libcore | |
| parent | 2567af67a6a0973937bc65f89f8b002829efad7a (diff) | |
| parent | 7c1e4054787f99dff36aa66318b7589f78dfc7d9 (diff) | |
| download | rust-1d7faafe47a3d34ef854609e7b4a5e48cc66e7a9.tar.gz rust-1d7faafe47a3d34ef854609e7b4a5e48cc66e7a9.zip | |
Rollup merge of #62746 - RalfJung:deprecated, r=KodrAus
do not use assume_init in std::io Cc https://github.com/rust-lang/rust/issues/62397
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/fmt/float.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs index 4bd7d3b4b22..a2fff913ac7 100644 --- a/src/libcore/fmt/float.rs +++ b/src/libcore/fmt/float.rs @@ -12,10 +12,11 @@ fn float_to_decimal_common_exact<T>(fmt: &mut Formatter<'_>, num: &T, unsafe { let mut buf = MaybeUninit::<[u8; 1024]>::uninit(); // enough for f32 and f64 let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 4]>::uninit(); - // FIXME(#53491): Technically, this is calling `get_mut` on an uninitialized - // `MaybeUninit` (here and elsewhere in this file). Revisit this once + // FIXME(#53491): This is calling `get_mut` on an uninitialized + // `MaybeUninit` (here and elsewhere in this file). Revisit this once // we decided whether that is valid or not. - // Using `freeze` is *not enough*; `flt2dec::Part` is an enum! + // We can do this only because we are libstd and coupled to the compiler. + // (FWIW, using `freeze` would not be enough; `flt2dec::Part` is an enum!) let formatted = flt2dec::to_exact_fixed_str(flt2dec::strategy::grisu::format_exact, *num, sign, precision, false, buf.get_mut(), parts.get_mut()); |
