diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-01-21 22:44:44 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-01-30 23:14:15 +0300 |
| commit | 4a4f8ff0a3eeb0855f03ad88c2f11f12761041f0 (patch) | |
| tree | a3754f8245c5d5ecad4afac3db82eb8445ef523e /src/liballoc | |
| parent | ffba0cea621c2609582b4e201b76b3b19860ec4f (diff) | |
| download | rust-4a4f8ff0a3eeb0855f03ad88c2f11f12761041f0.tar.gz rust-4a4f8ff0a3eeb0855f03ad88c2f11f12761041f0.zip | |
Implement Drop for Box
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/boxed.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index d98bc189292..b6f490e09cd 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -293,6 +293,14 @@ impl<T: ?Sized> Box<T> { } } +#[cfg(not(stage0))] +#[stable(feature = "rust1", since = "1.0.0")] +unsafe impl<#[may_dangle] T: ?Sized> Drop for Box<T> { + fn drop(&mut self) { + // FIXME: Do nothing, drop is currently performed by compiler. + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<T: Default> Default for Box<T> { /// Creates a `Box<T>`, with the `Default` value for T. |
