@@ -114,11 +114,14 @@ pub unsafe fn replace<T>(dest: *mut T, mut src: T) -> T {
114
114
/// # Safety
115
115
///
116
116
/// 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`]). Note that `*src = foo` counts as a use because it will attempt
121
+ /// to drop the value previously at `*src`.
122
+ ///
123
+ /// [`Copy`]: ../marker/trait.Copy.html
124
+ /// [`write`]: fn.write.html
122
125
///
123
126
/// # Examples
124
127
///
@@ -206,11 +209,14 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
206
209
/// # Safety
207
210
///
208
211
/// Beyond accepting a raw pointer, this is unsafe because it semantically
209
- /// moves the value out of `src` without preventing further usage of `src`.
210
- /// If `T` is not `Copy`, then care must be taken to ensure that the value at
211
- /// `src` is not used before the data is overwritten again (e.g. with `write`,
212
- /// `zero_memory`, or `copy_memory`). Note that `*src = foo` counts as a use
213
- /// because it will attempt to drop the value previously at `*src`.
212
+ /// moves the value out of `src` without preventing further usage of `src`. If
213
+ /// `T` is not [`Copy`], then care must be taken to ensure that the value at
214
+ /// `src` is not used before the data is overwritten again (e.g. with
215
+ /// [`write`]). Note that `*src = foo` counts as a use because it will attempt
216
+ /// to drop the value previously at `*src`.
217
+ ///
218
+ /// [`Copy`]: ../marker/trait.Copy.html
219
+ /// [`write`]: fn.write.html
214
220
///
215
221
/// # Examples
216
222
///
0 commit comments