Skip to content

Commit 5cc9513

Browse files
committed
Fix alignment check
1 parent bd69898 commit 5cc9513

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/collections/array_set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ where
261261
return Err(TranslationError::InvalidLength);
262262
}
263263

264-
if align_of_val(bytes) != align_of::<Self>() {
264+
if align_of_val(bytes) != align_of::<P>() {
265265
return Err(TranslationError::InvalidLength);
266266
}
267267

@@ -295,7 +295,7 @@ where
295295
return Err(TranslationError::InvalidLength);
296296
}
297297

298-
if align_of_val(bytes) != align_of::<Self>() {
298+
if align_of_val(bytes) < align_of::<P>() {
299299
return Err(TranslationError::InvalidLength);
300300
}
301301

0 commit comments

Comments
 (0)