diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-09-30 14:38:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-30 14:38:32 -0700 |
| commit | 913c095bcf97177d030e4bde9a45a0bb68873eaf (patch) | |
| tree | be392b01361811cd2585d4e763fd671fce9ac991 | |
| parent | e9d28796ecf8042e8a0e3758ebd1b4af5a0f55d4 (diff) | |
| parent | cdf1852a61db9d21fc36dfc806a960a28aa059c0 (diff) | |
| download | rust-913c095bcf97177d030e4bde9a45a0bb68873eaf.tar.gz rust-913c095bcf97177d030e4bde9a45a0bb68873eaf.zip | |
Rollup merge of #64923 - lzutao:improve-doc-needs_drop, r=jonas-schievink
Add missing links for mem::needs_drop r? @jonas-schievink
| -rw-r--r-- | src/libcore/mem/mod.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs index 8767625d4ed..95ad4272ced 100644 --- a/src/libcore/mem/mod.rs +++ b/src/libcore/mem/mod.rs @@ -368,15 +368,17 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize { /// make a difference in release builds (where a loop that has no side-effects /// is easily detected and eliminated), but is often a big win for debug builds. /// -/// Note that `ptr::drop_in_place` already performs this check, so if your workload -/// can be reduced to some small number of drop_in_place calls, using this is -/// unnecessary. In particular note that you can drop_in_place a slice, and that +/// Note that [`drop_in_place`] already performs this check, so if your workload +/// can be reduced to some small number of [`drop_in_place`] calls, using this is +/// unnecessary. In particular note that you can [`drop_in_place`] a slice, and that /// will do a single needs_drop check for all the values. /// /// Types like Vec therefore just `drop_in_place(&mut self[..])` without using -/// needs_drop explicitly. Types like `HashMap`, on the other hand, have to drop +/// `needs_drop` explicitly. Types like [`HashMap`], on the other hand, have to drop /// values one at a time and should use this API. /// +/// [`drop_in_place`]: ../ptr/fn.drop_in_place.html +/// [`HashMap`]: ../../std/collections/struct.HashMap.html /// /// # Examples /// |
