summaryrefslogtreecommitdiffstats
path: root/tests/ui/union/field_checks.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /tests/ui/union/field_checks.rs
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/union/field_checks.rs')
-rw-r--r--tests/ui/union/field_checks.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/ui/union/field_checks.rs b/tests/ui/union/field_checks.rs
index d5d1e44ac..bb4eccb4c 100644
--- a/tests/ui/union/field_checks.rs
+++ b/tests/ui/union/field_checks.rs
@@ -21,15 +21,15 @@ union U24<T> { // OK
}
union U3 {
- 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
}
union U32 { // field that does not drop but is not `Copy`, either
- a: std::cell::RefCell<i32>, //~ ERROR unions cannot contain fields that may need dropping
+ a: std::cell::RefCell<i32>, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union U4<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 U5 { // Having a drop impl is OK
@@ -41,11 +41,11 @@ impl Drop for U5 {
}
union U5Nested { // a nested union that drops is NOT OK
- nest: U5, //~ ERROR unions cannot contain fields that may need dropping
+ nest: U5, //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union U5Nested2 { // for now we don't special-case empty arrays
- nest: [U5; 0], //~ ERROR unions cannot contain fields that may need dropping
+ nest: [U5; 0], //~ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
}
union U6 { // OK