removes the maybe_uninit feature gate

and stop newtyping `core::mem::MaybeUninit`
This commit is contained in:
Jorge Aparicio 2019-05-21 14:18:43 +02:00
parent 6acb156482
commit fafc94ccfb
3 changed files with 21 additions and 51 deletions

View file

@ -68,36 +68,6 @@ impl Priority {
}
}
// We newtype `core::mem::MaybeUninit` so the end-user doesn't need `#![feature(maybe_uninit)]` in
// their code
pub struct MaybeUninit<T> {
inner: core::mem::MaybeUninit<T>,
}
impl<T> MaybeUninit<T> {
pub const fn uninit() -> Self {
MaybeUninit {
inner: core::mem::MaybeUninit::uninit(),
}
}
pub fn as_ptr(&self) -> *const T {
self.inner.as_ptr()
}
pub fn as_mut_ptr(&mut self) -> *mut T {
self.inner.as_mut_ptr()
}
pub unsafe fn read(&self) -> T {
self.inner.read()
}
pub fn write(&mut self, value: T) -> &mut T {
self.inner.write(value)
}
}
#[inline(always)]
pub fn assert_send<T>()
where