gotta mask that unsafe

This commit is contained in:
Lokathor 2019-09-20 11:08:40 -06:00 committed by GitHub
parent cc0a6aa751
commit 28603a3198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ pub fn try_zeroed_box<T: Zeroable>() -> Result<Box<T>, ()> {
// we don't know what the error is because `alloc_zeroed` is a dumb API // we don't know what the error is because `alloc_zeroed` is a dumb API
Err(()) Err(())
} else { } else {
Ok(Box::<T>::from_raw(ptr as *mut T)) Ok(unsafe { Box::<T>::from_raw(ptr as *mut T) })
} }
} }