fix: correct old rust builds

This commit is contained in:
Kyle Clemens
2019-10-08 20:08:32 -04:00
parent ce57cdae6a
commit fbaff474f6
2 changed files with 12 additions and 10 deletions
+8 -6
View File
@@ -35,13 +35,15 @@ impl Buffer {
#[inline]
#[cfg_attr(feature = "no-panic", no_panic)]
pub fn new() -> Self {
// assume_init is safe here, since this is an array of MaybeUninit, which does not need
// to be initialized.
#[cfg(maybe_uninit)]
let bytes = unsafe { MaybeUninit::uninit().assume_init() };
#[cfg(not(maybe_uninit))]
let bytes = unsafe { mem::uninitialized() };
Buffer {
// assume_init is safe here, since this is an array of MaybeUninit, which does not need
// to be initialized.
#[cfg(maybe_uninit)]
bytes: unsafe { MaybeUninit::uninit().assume_init() },
#[cfg(not(maybe_uninit))]
bytes: unsafe { mem::uninitialized() },
bytes: bytes,
}
}
+4 -4
View File
@@ -221,11 +221,11 @@ pub fn d2d(ieee_mantissa: u64, ieee_exponent: u32) -> FloatingDecimal64 {
#[cfg(maybe_uninit)]
{ vp_uninit.as_mut_ptr() },
#[cfg(not(maybe_uninit))]
{ &mut vp as *mut u64 },
{ &mut vp },
#[cfg(maybe_uninit)]
{ vm_uninit.as_mut_ptr() },
#[cfg(not(maybe_uninit))]
{ &mut vm as *mut u64 },
{ &mut vm },
mm_shift,
);
#[cfg(maybe_uninit)]
@@ -272,11 +272,11 @@ pub fn d2d(ieee_mantissa: u64, ieee_exponent: u32) -> FloatingDecimal64 {
#[cfg(maybe_uninit)]
{ vp_uninit.as_mut_ptr() },
#[cfg(not(maybe_uninit))]
{ &mut vp as *mut u64 },
{ &mut vp },
#[cfg(maybe_uninit)]
{ vm_uninit.as_mut_ptr() },
#[cfg(not(maybe_uninit))]
{ &mut vm as *mut u64 },
{ &mut vm },
mm_shift,
);
#[cfg(maybe_uninit)]