From fabb4b0661c1ece43d7e0011c88f9ae225691608 Mon Sep 17 00:00:00 2001 From: est31 Date: Thu, 21 Jul 2022 23:54:16 +0200 Subject: [PATCH] Statically ensure the size of ItemKind --- src/librustdoc/clean/types.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 874cf5508d1..d022ce9696a 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -771,6 +771,10 @@ pub(crate) enum ItemKind { KeywordItem, } +// `ItemKind` is an enum and large variants can bloat up memory usage even for smaller ones +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +rustc_data_structures::static_assert_size!(ItemKind, 112); + impl ItemKind { /// Some items contain others such as structs (for their fields) and Enums /// (for their variants). This method returns those contained items.