summaryrefslogtreecommitdiffstats
path: root/tests/ui/print_type_sizes/repr_int_c.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/print_type_sizes/repr_int_c.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/print_type_sizes/repr_int_c.rs b/tests/ui/print_type_sizes/repr_int_c.rs
new file mode 100644
index 000000000..6b103776a
--- /dev/null
+++ b/tests/ui/print_type_sizes/repr_int_c.rs
@@ -0,0 +1,19 @@
+// compile-flags: -Z print-type-sizes --crate-type=lib
+// build-pass
+
+// This test makes sure that the tag is not grown for `repr(C)` or `repr(u8)`
+// variants (see https://github.com/rust-lang/rust/issues/50098 for the original bug).
+
+#![allow(dead_code)]
+
+#[repr(C, u8)]
+enum ReprCu8 {
+ A(u16),
+ B,
+}
+
+#[repr(u8)]
+enum Repru8 {
+ A(u16),
+ B,
+}