Statically ensure the size of ItemKind

This commit is contained in:
est31 2022-07-21 23:54:16 +02:00
parent 1116fc164f
commit fabb4b0661

View File

@ -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.