Skip to content

Commit b9fabc3

Browse files
committed
Add a static size assertion for MatcherPos.
1 parent 11c565f commit b9fabc3

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
@@ -207,6 +207,10 @@ struct MatcherPos<'root, 'tt> {
207207
stack: SmallVec<[MatcherTtFrame<'tt>; 1]>,
208208
}
209209

210+
// This type is used a lot. Make sure it doesn't unintentionally get bigger.
211+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
212+
rustc_data_structures::static_assert_size!(MatcherPos<'_, '_>, 192);
213+
210214
impl<'root, 'tt> MatcherPos<'root, 'tt> {
211215
/// Adds `m` as a named match for the `idx`-th metavar.
212216
fn push_match(&mut self, idx: usize, m: NamedMatch) {

0 commit comments

Comments
 (0)