rustdoc: Add static size assertion for DocFragment

Tons of them are constructed, so the size has a big impact on max-rss.
This commit is contained in:
Noah Lev 2021-11-19 21:41:23 -05:00
parent a77da2d454
commit 8b8f1e069f

View file

@ -918,6 +918,10 @@ crate struct DocFragment {
crate indent: usize,
}
// `DocFragment` 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!(DocFragment, 32);
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
crate enum DocFragmentKind {
/// A doc fragment created from a `///` or `//!` doc comment.