mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Add static assertions to nodes (#6228)
This commit is contained in:
parent
07468f8be9
commit
ecfdd8d58b
3 changed files with 15 additions and 0 deletions
|
@ -28,6 +28,7 @@ once_cell = { workspace = true }
|
|||
rustc-hash = { workspace = true }
|
||||
serde = { workspace = true, optional = true }
|
||||
smallvec = { workspace = true }
|
||||
static_assertions = "1.1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
insta = { workspace = true }
|
||||
|
|
|
@ -3044,3 +3044,16 @@ impl Ranged for crate::nodes::ArgWithDefault {
|
|||
self.range
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
mod size_assertions {
|
||||
#[allow(clippy::wildcard_imports)]
|
||||
use super::*;
|
||||
use static_assertions::assert_eq_size;
|
||||
|
||||
assert_eq_size!(Stmt, [u8; 168]);
|
||||
assert_eq_size!(Expr, [u8; 80]);
|
||||
assert_eq_size!(Constant, [u8; 32]);
|
||||
assert_eq_size!(Pattern, [u8; 96]);
|
||||
assert_eq_size!(Mod, [u8; 64]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue