Skip to content

Commit c44c82d

Browse files
committed
Assert size of rustc_parse_format::Piece<'_>
1 parent 78060cb commit c44c82d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4148,6 +4148,7 @@ dependencies = [
41484148
name = "rustc_parse_format"
41494149
version = "0.0.0"
41504150
dependencies = [
4151+
"rustc_data_structures",
41514152
"rustc_lexer",
41524153
]
41534154

compiler/rustc_parse_format/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ edition = "2021"
55

66
[dependencies]
77
rustc_lexer = { path = "../rustc_lexer" }
8+
rustc_data_structures = { path = "../rustc_data_structures" }

compiler/rustc_parse_format/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -908,5 +908,9 @@ fn find_skips_from_snippet(
908908
(skips, true)
909909
}
910910

911+
// Assert a reasonable size for `Piece`
912+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
913+
rustc_data_structures::static_assert_size!(Piece<'_>, 16);
914+
911915
#[cfg(test)]
912916
mod tests;

0 commit comments

Comments
 (0)