Skip to content

Commit e6b9fcc

Browse files
committed
Add a size assertion for Token.
1 parent ddf62b5 commit e6b9fcc

File tree

1 file changed

+7
-0
lines changed
  • compiler/rustc_parse/src/lexer

1 file changed

+7
-0
lines changed

compiler/rustc_parse/src/lexer/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ mod unicode_chars;
2222

2323
use unescape_error_reporting::{emit_unescape_error, escaped_char};
2424

25+
// This type is used a lot. Make sure it doesn't unintentionally get bigger.
26+
//
27+
// This assertion is in this crate, rather than in `rustc_lexer`, because that
28+
// crate cannot depend on `rustc_data_structures`.
29+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
30+
rustc_data_structures::static_assert_size!(rustc_lexer::Token, 72);
31+
2532
#[derive(Clone, Debug)]
2633
pub struct UnmatchedBrace {
2734
pub expected_delim: Delimiter,

0 commit comments

Comments
 (0)