Function core::mem::align_of_val_raw[][src]

pub unsafe fn align_of_val_raw<T: ?Sized>(val: *const T) -> usize
🔬 This is a nightly-only experimental API. (layout_for_ptr #69835)

Returns the ABI-required minimum alignment of the type of the value that val points to.

Every reference to a value of the type T must be a multiple of this number.

Safety

This function is only safe to call if the following conditions hold:

Examples

#![feature(layout_for_ptr)]
use std::mem;

assert_eq!(4, unsafe { mem::align_of_val_raw(&5i32) });
Run