Skip to content

Commit 804103b

Browse files
committed
Add a size assertion for Parser.
1 parent f1c32c1 commit 804103b

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_parse/src/parser

1 file changed

+5
-0
lines changed

compiler/rustc_parse/src/parser/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ pub struct Parser<'a> {
150150
pub current_closure: Option<ClosureSpans>,
151151
}
152152

153+
// This type is used a lot, e.g. it's cloned when matching many declarative macro rules. Make sure
154+
// it doesn't unintentionally get bigger.
155+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
156+
rustc_data_structures::static_assert_size!(Parser<'_>, 328);
157+
153158
/// Stores span information about a closure.
154159
#[derive(Clone)]
155160
pub struct ClosureSpans {

0 commit comments

Comments
 (0)