diff options
| author | bors <bors@rust-lang.org> | 2017-10-13 17:42:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-10-13 17:42:25 +0000 |
| commit | 6cb49d2a3e86f0d2f220f12c59c0ebb2965ff38c (patch) | |
| tree | 601f0856be5a7da5d29c176fb415f7b803643670 /src/libcore | |
| parent | 305e02281bf6e7a5398f93f86c901316074be0a5 (diff) | |
| parent | 8ea67902934728378acdd84a6050b9b4bed03ad5 (diff) | |
| download | rust-6cb49d2a3e86f0d2f220f12c59c0ebb2965ff38c.tar.gz rust-6cb49d2a3e86f0d2f220f12c59c0ebb2965ff38c.zip | |
Auto merge of #45261 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests - Successful merges: #44855, #45110, #45122, #45133, #45173, #45178, #45189, #45203, #45209, #45221, #45236, #45240, #45245, #45253 - Failed merges:
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/mem.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 680a0f5b2c0..16d5fadc536 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -429,9 +429,11 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize { /// Returns whether dropping values of type `T` matters. /// -/// This is purely an optimization hint, and may be implemented conservatively. -/// For instance, always returning `true` would be a valid implementation of -/// this function. +/// This is purely an optimization hint, and may be implemented conservatively: +/// it may return `true` for types that don't actually need to be dropped. +/// As such always returning `true` would be a valid implementation of +/// this function. However if this function actually returns `false`, then you +/// can be certain dropping `T` has no side effect. /// /// Low level implementations of things like collections, which need to manually /// drop their data, should use this function to avoid unnecessarily |
