std::intrinsics

Function ptr_metadata

const: 1.83.0 · Source
pub const fn ptr_metadata<P, M>(_ptr: *const P) -> M
where P: Pointee<Metadata = M> + ?Sized,
🔬This is a nightly-only experimental API. (core_intrinsics)
Expand description

Lowers in MIR to Rvalue::UnaryOp with UnOp::PtrMetadata.

This is used to implement functions like ptr::metadata.