Add language options.

This commit is contained in:
Stephen Chung
2021-12-03 11:16:35 +08:00
parent 9a5bd9396a
commit 7cd76c6d18
9 changed files with 151 additions and 23 deletions

View File

@@ -15,8 +15,10 @@ fn check_struct_sizes() {
assert_eq!(size_of::<Dynamic>(), if PACKED { 8 } else { 16 });
assert_eq!(size_of::<Option<Dynamic>>(), if PACKED { 8 } else { 16 });
#[cfg(not(feature = "no_position"))]
assert_eq!(size_of::<Position>(), 4);
assert_eq!(
size_of::<Position>(),
if cfg!(feature = "no_position") { 0 } else { 4 }
);
assert_eq!(size_of::<ast::Expr>(), 16);
assert_eq!(size_of::<Option<ast::Expr>>(), 16);
assert_eq!(size_of::<ast::Stmt>(), 32);