Skip to content

Commit 263c426

Browse files
committed
Add size assertions for FnAbi and ArgAbi.
1 parent a1bea15 commit 263c426

File tree

1 file changed

+10
-0
lines changed
  • compiler/rustc_target/src/abi/call

1 file changed

+10
-0
lines changed

compiler/rustc_target/src/abi/call/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -730,3 +730,13 @@ impl<'a, Ty> FnAbi<'a, Ty> {
730730
Ok(())
731731
}
732732
}
733+
734+
// Some types are used a lot. Make sure they don't unintentionally get bigger.
735+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
736+
mod size_asserts {
737+
use super::*;
738+
use rustc_data_structures::static_assert_size;
739+
// These are in alphabetical order, which is easy to maintain.
740+
static_assert_size!(ArgAbi<'_, usize>, 208);
741+
static_assert_size!(FnAbi<'_, usize>, 248);
742+
}

0 commit comments

Comments
 (0)