From 27d47d93be38911c365b11ad36536e4ed926fc76 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Thu, 28 Oct 2021 20:58:53 -0700 Subject: [PATCH] rustdoc: Add static size assertion for `clean::Crate` --- 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 6ae057abb3d..4604315ac69 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -125,6 +125,10 @@ crate struct Crate { crate collapsed: bool, } +// `Crate` is frequently moved by-value. Make sure it doesn't unintentionally get bigger. +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +rustc_data_structures::static_assert_size!(Crate, 168); + /// This struct is used to wrap additional information added by rustdoc on a `trait` item. #[derive(Clone, Debug)] crate struct TraitWithExtraInfo {