Skip to content

Commit 3ae109a

Browse files
committed
Relax size assertion
This was overzealous according to @FractalFir and I am hitting it as well.
1 parent a51d85f commit 3ae109a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/cust/src/module.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ impl Module {
362362
///
363363
/// # Panics:
364364
///
365-
/// This function panics if the size of the symbol is not the same as the `mem::sizeof<T>()`.
365+
/// This function panics if the size of the symbol is greater than
366+
/// `mem::sizeof<T>()`.
366367
///
367368
/// # Examples
368369
///
@@ -397,7 +398,7 @@ impl Module {
397398
name.as_ptr(),
398399
)
399400
.to_result()?;
400-
assert_eq!(size, mem::size_of::<T>());
401+
assert!(size <= mem::size_of::<T>());
401402
Ok(Symbol {
402403
ptr,
403404
module: PhantomData,

0 commit comments

Comments
 (0)