all: warn on unsafe-op-in-unsafe-fn
This commit is contained in:
parent
ce7488aa86
commit
73a6e0d5c2
25 changed files with 435 additions and 340 deletions
|
|
@ -9,20 +9,20 @@ pub trait MutPtrExt<T: ?Sized> {
|
|||
impl<T: ?Sized> PtrExt<T> for *const T {
|
||||
#[inline(always)]
|
||||
unsafe fn deref<'a>(self) -> &'a T {
|
||||
&*self
|
||||
unsafe { &*self }
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ?Sized> PtrExt<T> for *mut T {
|
||||
#[inline(always)]
|
||||
unsafe fn deref<'a>(self) -> &'a T {
|
||||
&*self
|
||||
unsafe { &*self }
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ?Sized> MutPtrExt<T> for *mut T {
|
||||
#[inline(always)]
|
||||
unsafe fn deref_mut<'a>(self) -> &'a mut T {
|
||||
&mut *self
|
||||
unsafe { &mut *self }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue