about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-12-08 11:20:01 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-12-08 22:50:39 +0000
commitc44c82de2b174d0ca6184d15602ffc33fdbd8ae6 (patch)
treef825d178d638ca25c0b8245f18ef50ea9d0fba54
parent78060cb6de9aba3be1dc5c883cf54eb98a084e22 (diff)
downloadrust-c44c82de2b174d0ca6184d15602ffc33fdbd8ae6.tar.gz
rust-c44c82de2b174d0ca6184d15602ffc33fdbd8ae6.zip
Assert size of `rustc_parse_format::Piece<'_>`
-rw-r--r--Cargo.lock1
-rw-r--r--compiler/rustc_parse_format/Cargo.toml1
-rw-r--r--compiler/rustc_parse_format/src/lib.rs4
3 files changed, 6 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 970b1719aa1..50fc0f1a440 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4148,6 +4148,7 @@ dependencies = [
 name = "rustc_parse_format"
 version = "0.0.0"
 dependencies = [
+ "rustc_data_structures",
  "rustc_lexer",
 ]
 
diff --git a/compiler/rustc_parse_format/Cargo.toml b/compiler/rustc_parse_format/Cargo.toml
index fcc68b3a219..72da398d3fc 100644
--- a/compiler/rustc_parse_format/Cargo.toml
+++ b/compiler/rustc_parse_format/Cargo.toml
@@ -5,3 +5,4 @@ edition = "2021"
 
 [dependencies]
 rustc_lexer = { path = "../rustc_lexer" }
+rustc_data_structures = { path = "../rustc_data_structures" }
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs
index 4d01f706272..9cbe04c1288 100644
--- a/compiler/rustc_parse_format/src/lib.rs
+++ b/compiler/rustc_parse_format/src/lib.rs
@@ -908,5 +908,9 @@ fn find_skips_from_snippet(
     (skips, true)
 }
 
+// Assert a reasonable size for `Piece`
+#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
+rustc_data_structures::static_assert_size!(Piece<'_>, 16);
+
 #[cfg(test)]
 mod tests;