-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Description
Method peek_from_uninit
creates a &mut T
where the T
is uninitialised, this is UB AFAIK.
webrender/peek-poke/src/lib.rs
Lines 33 to 39 in efec276
/// Peek helper for constructing a `T` by `Copy`ing into an uninitialized stack | |
/// allocation. | |
pub unsafe fn peek_from_uninit<T: Copy + Peek>(bytes: *const u8) -> (T, *const u8) { | |
let mut val = MaybeUninitShim { uninit: () }; | |
let bytes = <T>::peek_from(bytes, &mut val.init); | |
(val.init, bytes) | |
} |
Metadata
Metadata
Assignees
Labels
No labels