From 804103b0aedf38cbc1a0c0dbf37a627eb48b8902 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 20 Apr 2022 09:31:34 +1000 Subject: [PATCH] Add a size assertion for `Parser`. --- compiler/rustc_parse/src/parser/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 925d6ac405b..67bfb98ccd3 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -150,6 +150,11 @@ pub struct Parser<'a> { pub current_closure: Option, } +// This type is used a lot, e.g. it's cloned when matching many declarative macro rules. Make sure +// it doesn't unintentionally get bigger. +#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] +rustc_data_structures::static_assert_size!(Parser<'_>, 328); + /// Stores span information about a closure. #[derive(Clone)] pub struct ClosureSpans {