From 904e70a7b00f41b168add13a33bc14f200442ad0 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 23 Mar 2022 11:44:13 +1100 Subject: [PATCH] Add a size assertion for `NamedMatchVec`. --- compiler/rustc_expand/src/mbe/macro_parser.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_expand/src/mbe/macro_parser.rs b/compiler/rustc_expand/src/mbe/macro_parser.rs index d8071bf159a..8eaa6d3131c 100644 --- a/compiler/rustc_expand/src/mbe/macro_parser.rs +++ b/compiler/rustc_expand/src/mbe/macro_parser.rs @@ -103,6 +103,10 @@ struct MatcherTtFrame<'tt> { type NamedMatchVec = SmallVec<[NamedMatch; 4]>; +// This 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!(NamedMatchVec, 72); + /// Represents a single "position" (aka "matcher position", aka "item"), as /// described in the module documentation. #[derive(Clone)]