Skip to content

Commit 8c165d0

Browse files
committed
Relax size assertion
This was overzealous according to @FractalFir and I am hitting it as well.
1 parent 44c44ba commit 8c165d0

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
@@ -340,7 +340,8 @@ impl Module {
340340
///
341341
/// # Panics:
342342
///
343-
/// This function panics if the size of the symbol is not the same as the `mem::sizeof<T>()`.
343+
/// This function panics if the size of the symbol is greater than
344+
/// `mem::sizeof<T>()`.
344345
///
345346
/// # Examples
346347
///
@@ -375,7 +376,7 @@ impl Module {
375376
name.as_ptr(),
376377
)
377378
.to_result()?;
378-
assert_eq!(size, mem::size_of::<T>());
379+
assert!(size <= mem::size_of::<T>());
379380
Ok(Symbol {
380381
ptr,
381382
module: PhantomData,

0 commit comments

Comments
 (0)