From 10b9b3d383482b55df985fb7fdc03be887b3039d Mon Sep 17 00:00:00 2001
From: Noah Lev <camelidcamel@gmail.com>
Date: Sun, 17 Oct 2021 13:20:43 -0700
Subject: [PATCH] Add static size assertion for `clean::Type`

---
 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 d4cea8b4a9d..9dab0023ba3 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -1450,6 +1450,10 @@ crate enum Type {
     ImplTrait(Vec<GenericBound>),
 }
 
+// `Type` is used a lot. Make sure it doesn't unintentionally get bigger.
+#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+rustc_data_structures::static_assert_size!(Type, 72);
+
 crate trait GetDefId {
     /// Use this method to get the [`DefId`] of a [`clean`] AST node.
     /// This will return [`None`] when called on a primitive [`clean::Type`].