Skip to content

Commit 904e70a

Browse files
committed
Add a size assertion for NamedMatchVec.
1 parent a4a5e79 commit 904e70a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_expand/src/mbe/macro_parser.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ struct MatcherTtFrame<'tt> {
103103

104104
type NamedMatchVec = SmallVec<[NamedMatch; 4]>;
105105

106+
// This type is used a lot. Make sure it doesn't unintentionally get bigger.
107+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
108+
rustc_data_structures::static_assert_size!(NamedMatchVec, 72);
109+
106110
/// Represents a single "position" (aka "matcher position", aka "item"), as
107111
/// described in the module documentation.
108112
#[derive(Clone)]

0 commit comments

Comments
 (0)