Add static assertion for the size of ItemKind

This commit is contained in:
Joshua Nelson 2020-12-29 00:31:46 -05:00
parent 4a4426377e
commit 5fce0dd787

View File

@ -88,6 +88,10 @@ crate struct Item {
crate def_id: DefId,
}
// `Item` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
rustc_data_structures::static_assert_size!(Item, 136);
impl fmt::Debug for Item {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
let def_id: &dyn fmt::Debug = if self.is_fake() { &"**FAKE**" } else { &self.def_id };