pub const fn from_ref<T>(r: &T) -> *const Twhere
    T: ?Sized,
🔬This is a nightly-only experimental API. (ptr_from_ref)
Available on non-crate feature miri-test-libstd only.
Expand description

Convert a reference to a raw pointer.

This is equivalent to r as *const T, but is a bit safer since it will never silently change type or mutability, in particular if the code is refactored.