We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05d064d commit 165cdefCopy full SHA for 165cdef
src/lib.rs
@@ -160,7 +160,7 @@ impl<const N: usize> Align4<[u8; N]> {
160
#[must_use]
161
pub const fn as_slice<T: Sized>(&self) -> &[T] {
162
const {
163
- assert!(N % size_of::<T>() == 0);
+ assert!(N % (size_of::<T>() + (size_of::<T>() % align_of::<T>())) == 0);
164
assert!(
165
align_of::<T>() == 4 || align_of::<T>() == 2 || align_of::<T>() == 1
166
);
0 commit comments