diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2021-11-19 21:41:23 -0500 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2021-11-19 21:41:23 -0500 |
| commit | 8b8f1e069fd6b81cdedf2d7ef80460a7a51d36ef (patch) | |
| tree | 08d985bd192daf2d36e1f1f2ab9b889acbab9262 | |
| parent | a77da2d454e6caa227a85b16410b95f93495e7e0 (diff) | |
| download | rust-8b8f1e069fd6b81cdedf2d7ef80460a7a51d36ef.tar.gz rust-8b8f1e069fd6b81cdedf2d7ef80460a7a51d36ef.zip | |
rustdoc: Add static size assertion for DocFragment
Tons of them are constructed, so the size has a big impact on max-rss.
| -rw-r--r-- | src/librustdoc/clean/types.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 41ebf270ba6..137660355c3 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -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. |
