Function align_of_val_raw

unsafe const fn align_of_val_raw<T: ?Sized>(val: *const T) -> usize

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

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) });