Skip to content

Commit

Permalink
Statically ensure the size of ItemKind
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Jul 29, 2022
1 parent 1116fc1 commit fabb4b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit fabb4b0

Please sign in to comment.