Skip to main content

wipe_in_place_mut

Function wipe_in_place_mut 

Source
pub unsafe fn wipe_in_place_mut<T>(value: &mut T)
Expand description

Caller must ensure that after this function returns, no code reads *value as a T.

§Safety

Zeroing the bytes may produce an invalid T (niches, validity invariants on inner fields, etc.). Typically used inside Drop, where Rust’s drop semantics already guarantee no further reads.

WARN: authorship is from @luisschwab while reading a go discord’s topic. It’s improvised and need auction.