bytes::bytes_mut

Function invalid_ptr

Source
fn invalid_ptr<T>(addr: usize) -> *mut T
Expand description

Returns a dangling pointer with the given address. This is used to store integer data in pointer fields.

It is equivalent to addr as *mut T, but this fails on miri when strict provenance checking is enabled.