Trait Alias core::ptr::Thin

source ·
trait Thin = Pointee<Metadata = ()>;
🔬This is a nightly-only experimental API. (ptr_metadata #81513)
Expand description

Pointers to types implementing this trait alias are “thin”.

This includes statically-Sized types and extern types.

§Example

#![feature(ptr_metadata)]

fn this_never_panics<T: std::ptr::Thin>() {
    assert_eq!(std::mem::size_of::<&T>(), std::mem::size_of::<usize>())
}
Run