mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 06:15:45 +01:00
removes the maybe_uninit feature gate
and stop newtyping `core::mem::MaybeUninit`
This commit is contained in:
parent
6acb156482
commit
fafc94ccfb
3 changed files with 21 additions and 51 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue