@@ -114,11 +114,17 @@ pub unsafe fn replace<T>(dest: *mut T, mut src: T) -> T {
114114/// # Safety
115115///
116116/// Beyond accepting a raw pointer, this is unsafe because it semantically
117- /// moves the value out of `src` without preventing further usage of `src`.
118- /// If `T` is not `Copy`, then care must be taken to ensure that the value at
119- /// `src` is not used before the data is overwritten again (e.g. with `write`,
120- /// `zero_memory`, or `copy_memory`). Note that `*src = foo` counts as a use
121- /// because it will attempt to drop the value previously at `*src`.
117+ /// moves the value out of `src` without preventing further usage of `src`. If
118+ /// `T` is not [`Copy`], then care must be taken to ensure that the value at
119+ /// `src` is not used before the data is overwritten again (e.g. with
120+ /// [`write`], [`zero_memory`], or [`copy_memory`]). Note that `*src = foo`
121+ /// counts as a use because it will attempt to drop the value previously at
122+ /// `*src`.
123+ ///
124+ /// [`Copy`]: ../marker/trait.Copy.html
125+ /// [`write`]: fn.write.html
126+ /// [`zero_memory`]: fn.zero_memory.html
127+ /// [`copy_memory`]: fn.copy_memory.html
122128///
123129/// # Examples
124130///
@@ -193,11 +199,17 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
193199/// # Safety
194200///
195201/// Beyond accepting a raw pointer, this is unsafe because it semantically
196- /// moves the value out of `src` without preventing further usage of `src`.
197- /// If `T` is not `Copy`, then care must be taken to ensure that the value at
198- /// `src` is not used before the data is overwritten again (e.g. with `write`,
199- /// `zero_memory`, or `copy_memory`). Note that `*src = foo` counts as a use
200- /// because it will attempt to drop the value previously at `*src`.
202+ /// moves the value out of `src` without preventing further usage of `src`. If
203+ /// `T` is not [`Copy`], then care must be taken to ensure that the value at
204+ /// `src` is not used before the data is overwritten again (e.g. with
205+ /// [`write`], [`zero_memory`], or [`copy_memory`]). Note that `*src = foo`
206+ /// counts as a use because it will attempt to drop the value previously at
207+ /// `*src`.
208+ ///
209+ /// [`Copy`]: ../marker/trait.Copy.html
210+ /// [`write`]: fn.write.html
211+ /// [`zero_memory`]: fn.zero_memory.html
212+ /// [`copy_memory`]: fn.copy_memory.html
201213///
202214/// # Examples
203215///
0 commit comments