mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-19 18:55:01 +00:00
fix: ensure expr and type enum are not too big (#811)
This commit is contained in:
parent
3469e215eb
commit
7ab125bbc2
2 changed files with 10 additions and 1 deletions
|
@ -1180,3 +1180,12 @@ fn extract_ref(step: Option<Expr>) -> (Option<Expr>, Option<Expr>) {
|
|||
fn none_expr() -> Expr {
|
||||
Expr::Type(Ty::Builtin(BuiltinTy::None))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn test_expr_size() {
|
||||
use super::*;
|
||||
assert!(size_of::<Expr>() <= size_of::<usize>() * 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1198,7 +1198,7 @@ mod tests {
|
|||
#[test]
|
||||
fn test_ty_size() {
|
||||
use super::*;
|
||||
assert!(size_of::<Ty>() == 16);
|
||||
assert!(size_of::<Ty>() <= size_of::<usize>() * 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue