From e8b811af28a485ef2d2acc845946eacc05545685 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 4 Sep 2021 11:59:07 +0800 Subject: [PATCH] Add test for minimal build Dynamic size. --- src/ast.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index 40b90dfb..81ba4b76 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -2332,8 +2332,14 @@ mod tests { use crate::*; use std::mem::size_of; - assert_eq!(size_of::(), 16); - assert_eq!(size_of::>(), 16); + let packed = cfg!(all( + target_pointer_width = "32", + feature = "only_i32", + feature = "no_float" + )); + + assert_eq!(size_of::(), if packed { 8 } else { 16 }); + assert_eq!(size_of::>(), if packed { 8 } else { 16 }); #[cfg(not(feature = "no_position"))] assert_eq!(size_of::(), 4); assert_eq!(size_of::(), 16);