Navigation Menu

Skip to content

Commit

Permalink
Add static size assertion for clean::Type
Browse files Browse the repository at this point in the history
  • Loading branch information
camelid committed Oct 17, 2021
1 parent 8db8f48 commit 10b9b3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustdoc/clean/types.rs
Expand Up @@ -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`].
Expand Down

0 comments on commit 10b9b3d

Please sign in to comment.