about summary refs log tree commit diff
path: root/src/libcore/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-14 08:32:59 +0000
committerbors <bors@rust-lang.org>2018-08-14 08:32:59 +0000
commit5bb923988f949639f11dba0c1ab1980fe8dfec3d (patch)
tree7916ac62e655674abfafde761e925e472d08091c /src/libcore/tests
parenta8763b5370ed044b6e703981217f074e8ddf1e7c (diff)
parent5ee5a7eb5568011b29a9fee16b00e2b576603da3 (diff)
downloadrust-5bb923988f949639f11dba0c1ab1980fe8dfec3d.tar.gz
rust-5bb923988f949639f11dba0c1ab1980fe8dfec3d.zip
Auto merge of #53033 - RalfJung:manually_dro, r=SimonSapin
unsized ManuallyDrop

I think this matches what @eddyb had in https://github.com/rust-lang/rust/pull/52711 originally.

~~However, I have never added a `CoerceUnsized` before so I am not sure if I did this right. I copied the `unstable` attribute on the `impl` from elsewhere, but AFAIK it is useless because `impl`'s are insta-stable... so shouldn't this rather say "stable since 1.30"?~~

This is insta-stable and hence requires FCP, at least.

Fixes https://github.com/rust-lang/rust/issues/47034
Diffstat (limited to 'src/libcore/tests')
-rw-r--r--src/libcore/tests/manually_drop.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/tests/manually_drop.rs b/src/libcore/tests/manually_drop.rs
index 96bc9247da6..82dfb8d4c0b 100644
--- a/src/libcore/tests/manually_drop.rs
+++ b/src/libcore/tests/manually_drop.rs
@@ -21,4 +21,9 @@ fn smoke() {
 
     let x = ManuallyDrop::new(TypeWithDrop);
     drop(x);
+
+    // also test unsizing
+    let x : Box<ManuallyDrop<[TypeWithDrop]>> =
+        Box::new(ManuallyDrop::new([TypeWithDrop, TypeWithDrop]));
+    drop(x);
 }