Skip to content

Commit 913c095

Browse files
authored
Rollup merge of #64923 - lzutao:improve-doc-needs_drop, r=jonas-schievink
Add missing links for mem::needs_drop r? @jonas-schievink
2 parents e9d2879 + cdf1852 commit 913c095

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/libcore/mem/mod.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,17 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
368368
/// make a difference in release builds (where a loop that has no side-effects
369369
/// is easily detected and eliminated), but is often a big win for debug builds.
370370
///
371-
/// Note that `ptr::drop_in_place` already performs this check, so if your workload
372-
/// can be reduced to some small number of drop_in_place calls, using this is
373-
/// unnecessary. In particular note that you can drop_in_place a slice, and that
371+
/// Note that [`drop_in_place`] already performs this check, so if your workload
372+
/// can be reduced to some small number of [`drop_in_place`] calls, using this is
373+
/// unnecessary. In particular note that you can [`drop_in_place`] a slice, and that
374374
/// will do a single needs_drop check for all the values.
375375
///
376376
/// Types like Vec therefore just `drop_in_place(&mut self[..])` without using
377-
/// needs_drop explicitly. Types like `HashMap`, on the other hand, have to drop
377+
/// `needs_drop` explicitly. Types like [`HashMap`], on the other hand, have to drop
378378
/// values one at a time and should use this API.
379379
///
380+
/// [`drop_in_place`]: ../ptr/fn.drop_in_place.html
381+
/// [`HashMap`]: ../../std/collections/struct.HashMap.html
380382
///
381383
/// # Examples
382384
///

0 commit comments

Comments
 (0)