@@ -111,11 +111,15 @@ pub unsafe fn replace<T>(dest: *mut T, mut src: T) -> T {
111111/// # Safety
112112///
113113/// Beyond accepting a raw pointer, this is unsafe because it semantically
114- /// moves the value out of `src` without preventing further usage of `src`.
115- /// If `T` is not `Copy`, then care must be taken to ensure that the value at
116- /// `src` is not used before the data is overwritten again (e.g. with `write`,
117- /// `zero_memory`, or `copy_memory`). Note that `*src = foo` counts as a use
118- /// because it will attempt to drop the value previously at `*src`.
114+ /// moves the value out of `src` without preventing further usage of `src`. If
115+ /// `T` is not [`Copy`], then care must be taken to ensure that the value at
116+ /// `src` is not used before the data is overwritten again (e.g. with
117+ /// [`write`]). Note that `*src = foo`
118+ /// counts as a use because it will attempt to drop the value previously at
119+ /// `*src`.
120+ ///
121+ /// [`Copy`]: ../marker/trait.Copy.html
122+ /// [`write`]: fn.write.html
119123///
120124/// # Examples
121125///
@@ -190,11 +194,15 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
190194/// # Safety
191195///
192196/// Beyond accepting a raw pointer, this is unsafe because it semantically
193- /// moves the value out of `src` without preventing further usage of `src`.
194- /// If `T` is not `Copy`, then care must be taken to ensure that the value at
195- /// `src` is not used before the data is overwritten again (e.g. with `write`,
196- /// `zero_memory`, or `copy_memory`). Note that `*src = foo` counts as a use
197- /// because it will attempt to drop the value previously at `*src`.
197+ /// moves the value out of `src` without preventing further usage of `src`. If
198+ /// `T` is not [`Copy`], then care must be taken to ensure that the value at
199+ /// `src` is not used before the data is overwritten again (e.g. with
200+ /// [`write`]). Note that `*src = foo`
201+ /// counts as a use because it will attempt to drop the value previously at
202+ /// `*src`.
203+ ///
204+ /// [`Copy`]: ../marker/trait.Copy.html
205+ /// [`write`]: fn.write.html
198206///
199207/// # Examples
200208///
0 commit comments