Skip to content

Commit fabb4b0

Browse files
committed
Statically ensure the size of ItemKind
1 parent 1116fc1 commit fabb4b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustdoc/clean/types.rs

+4
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,10 @@ pub(crate) enum ItemKind {
771771
KeywordItem,
772772
}
773773

774+
// `ItemKind` is an enum and large variants can bloat up memory usage even for smaller ones
775+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
776+
rustc_data_structures::static_assert_size!(ItemKind, 112);
777+
774778
impl ItemKind {
775779
/// Some items contain others such as structs (for their fields) and Enums
776780
/// (for their variants). This method returns those contained items.

0 commit comments

Comments
 (0)