about summary refs log tree commit diff
path: root/tests/ui/union/union-sized-field.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/union/union-sized-field.rs')
-rw-r--r--tests/ui/union/union-sized-field.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/union/union-sized-field.rs b/tests/ui/union/union-sized-field.rs
new file mode 100644
index 00000000000..cb852eff0c6
--- /dev/null
+++ b/tests/ui/union/union-sized-field.rs
@@ -0,0 +1,19 @@
+use std::mem::ManuallyDrop;
+
+union Foo<T: ?Sized> {
+    value: ManuallyDrop<T>,
+    //~^ ERROR the size for values of type
+}
+
+struct Foo2<T: ?Sized> {
+    value: ManuallyDrop<T>,
+    //~^ ERROR the size for values of type
+    t: u32,
+}
+
+enum Foo3<T: ?Sized> {
+    Value(ManuallyDrop<T>),
+    //~^ ERROR the size for values of type
+}
+
+fn main() {}