pub fn check_alignment<M, T>(
	addr: Address<M, T>,
) -> Result<Address<M, T>, MisalignError<T>>
where M: Mutability {
	let ptr = addr.to_const();
	let mask = mem::align_of::<T>() - 1;
	if ptr as usize & mask != 0 {
		Err(MisalignError { ptr })
	}
	else {
		Ok(addr)
	}
}
/// Ensures that an address is well-aligned to its referent type width.
Ensures that an address is well-aligned to its referent type width.
Ensures that an address is well - aligned to its referent type width .
pub fn check_alignment<M, T>(
	addr: Address<M, T>,
) -> Result<Address<M, T>, MisalignError<T>>
where M: Mutability {
	let ptr = addr.to_const();
	let mask = mem::align_of::<T>() - 1;
	if ptr as usize & mask != 0 {
		Err(MisalignError { ptr })
	}
	else {
		Ok(addr)
	}
}
pub fn check_alignment < M , T > ( addr : Address < M , T > , ) -> Result < Address < M , T > , MisalignError < T > > where M : Mutability { let ptr = addr . to_const ( ) ; let mask = mem :: align_of :: < T > ( ) - 1 ; if ptr as usize & mask != 0 { Err ( MisalignError { ptr } ) } else { Ok ( addr ) } }
Ensures that an address is well-aligned to its referent type width.
Ensures that an address is well - aligned to its referent type width .
addr
Address<M, T>
addr
Address<M, T>