about summary refs log tree commit diff
path: root/tests/ui/union/union-with-drop-fields.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/union/union-with-drop-fields.rs')
-rw-r--r--tests/ui/union/union-with-drop-fields.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/ui/union/union-with-drop-fields.rs b/tests/ui/union/union-with-drop-fields.rs
index a7a8b69e784..9720830fb1f 100644
--- a/tests/ui/union/union-with-drop-fields.rs
+++ b/tests/ui/union/union-with-drop-fields.rs
@@ -8,7 +8,7 @@ union U {
 }
 
 union W {
-    a: String, //~ ERROR unions cannot contain fields that may need dropping
+    a: String, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
     b: String, // OK, only one field is reported
 }
 
@@ -16,12 +16,12 @@ struct S(String);
 
 // `S` doesn't implement `Drop` trait, but still has non-trivial destructor
 union Y {
-    a: S, //~ ERROR unions cannot contain fields that may need dropping
+    a: S, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
 }
 
 // We don't know if `T` is trivially-destructable or not until trans
 union J<T> {
-    a: T, //~ ERROR unions cannot contain fields that may need dropping
+    a: T, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
 }
 
 union H<T: Copy> {