Add compile-time assertion of Value's size (#15362)

# Description

Adds an assertion of `Value`'s size, similar to `Instruction` and
`Expr`.
This commit is contained in:
132ikl 2025-03-19 22:59:06 -04:00 committed by GitHub
parent 2c7ab6e898
commit 69d1c8e948
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -168,6 +168,11 @@ pub enum Value {
},
}
// This is to document/enforce the size of `Value` in bytes.
// We should try to avoid increasing the size of `Value`,
// and PRs that do so will have to change the number below so that it's noted in review.
const _: () = assert!(std::mem::size_of::<Value>() <= 48);
impl Clone for Value {
fn clone(&self) -> Self {
match self {