about summary refs log tree commit diff
path: root/tests/ui/layout/debug.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/layout/debug.rs')
-rw-r--r--tests/ui/layout/debug.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/ui/layout/debug.rs b/tests/ui/layout/debug.rs
index 91e96d78ff5..166321798de 100644
--- a/tests/ui/layout/debug.rs
+++ b/tests/ui/layout/debug.rs
@@ -76,3 +76,8 @@ impl S {
 
 #[rustc_layout(debug)]
 type Impossible = (str, str); //~ ERROR: cannot be known at compilation time
+
+// Test that computing the layout of an empty union doesn't ICE.
+#[rustc_layout(debug)]
+union EmptyUnion {} //~ ERROR: has an unknown layout
+//~^ ERROR: unions cannot have zero fields