unsafe {
let mut buf = MaybeUninit::<[u8; 1024]>::uninitialized(); // enough for f32 and f64
let mut parts = MaybeUninit::<[flt2dec::Part; 4]>::uninitialized();
+ // FIXME: Technically, 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.
let formatted = flt2dec::to_exact_fixed_str(flt2dec::strategy::grisu::format_exact,
*num, sign, precision,
false, buf.get_mut(), parts.get_mut());
///
/// It is up to the caller to guarantee that the `MaybeUninit` really is in an initialized
/// state, otherwise this will immediately cause undefined behavior.
+ // FIXME: We currently rely on the above being incorrect, i.e., we have references
+ // to uninitialized data (e.g. in `libstd/sys/windows/mutex.rs`). We should make
+ // a final decision about the rules before stabilization.
#[unstable(feature = "maybe_uninit", issue = "53491")]
#[inline(always)]
pub unsafe fn get_ref(&self) -> &T {
///
/// It is up to the caller to guarantee that the `MaybeUninit` really is in an initialized
/// state, otherwise this will immediately cause undefined behavior.
+ // FIXME: We currently rely on the above being incorrect, i.e., we have references
+ // to uninitialized data (e.g. in `libcore/fmt/float.rs`). We should make
+ // a final decision about the rules before stabilization.
#[unstable(feature = "maybe_uninit", issue = "53491")]
#[inline(always)]
pub unsafe fn get_mut(&mut self) -> &mut T {
}
pub unsafe fn init(&mut self) {
+ // FIXME: Technically, this is calling `get_ref` on an uninitialized
+ // `MaybeUninit`. Revisit this once we decided whether that is valid
+ // or not.
c::InitializeCriticalSection(self.inner.get_ref().get());
}