Skip to content

Commit 8b8f1e0

Browse files
committed
rustdoc: Add static size assertion for DocFragment
Tons of them are constructed, so the size has a big impact on max-rss.
1 parent a77da2d commit 8b8f1e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustdoc/clean/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,10 @@ crate struct DocFragment {
918918
crate indent: usize,
919919
}
920920

921+
// `DocFragment` is used a lot. Make sure it doesn't unintentionally get bigger.
922+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
923+
rustc_data_structures::static_assert_size!(DocFragment, 32);
924+
921925
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
922926
crate enum DocFragmentKind {
923927
/// A doc fragment created from a `///` or `//!` doc comment.

0 commit comments

Comments
 (0)