diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-27 11:42:35 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-27 20:37:37 +0530 |
| commit | 6a97fbab4b7bdfc0ad4e23c46a65ba3b685eb730 (patch) | |
| tree | 43e30d2185b8e55589eebcef924fb95eb202cb9a /src/libcore | |
| parent | 5d4e01766bd0b3b171149d41effe5564caf0a38b (diff) | |
| parent | 9a6e3b900f458fd82c25e7679be2c8860aba4f22 (diff) | |
| download | rust-6a97fbab4b7bdfc0ad4e23c46a65ba3b685eb730.tar.gz rust-6a97fbab4b7bdfc0ad4e23c46a65ba3b685eb730.zip | |
Rollup merge of #22818 - pnkfelix:fsk-issue-22536, r=nikomatsakis
Ensure we do not zero when \"moving\" types that are Copy. Uses more precise `type_needs_drop` for deciding about emitting cleanup code. Added notes about the weaknesses regarding `ty::type_contents` here. Fix #22536
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/intrinsics.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index e7af0be88a0..1ca243134cc 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -241,7 +241,12 @@ extern "rust-intrinsic" { /// will trigger a compiler error. pub fn return_address() -> *const u8; - /// Returns `true` if a type requires drop glue. + /// Returns `true` if the actual type given as `T` requires drop + /// glue; returns `false` if the actual type provided for `T` + /// implements `Copy`. + /// + /// If the actual type neither requires drop glue nor implements + /// `Copy`, then may return `true` or `false`. pub fn needs_drop<T>() -> bool; /// Returns `true` if a type is managed (will be allocated on the local heap) |
