@@ -111,11 +111,17 @@ pub unsafe fn replace<T>(dest: *mut T, mut src: T) -> T {
111
111
/// # Safety
112
112
///
113
113
/// 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`], [`zero_memory`], or [`copy_memory`]). 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
123
+ /// [`zero_memory`]: fn.zero_memory.html
124
+ /// [`copy_memory`]: fn.copy_memory.html
119
125
///
120
126
/// # Examples
121
127
///
@@ -190,11 +196,17 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
190
196
/// # Safety
191
197
///
192
198
/// 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`.
199
+ /// moves the value out of `src` without preventing further usage of `src`. If
200
+ /// `T` is not [`Copy`], then care must be taken to ensure that the value at
201
+ /// `src` is not used before the data is overwritten again (e.g. with
202
+ /// [`write`], [`zero_memory`], or [`copy_memory`]). Note that `*src = foo`
203
+ /// counts as a use because it will attempt to drop the value previously at
204
+ /// `*src`.
205
+ ///
206
+ /// [`Copy`]: ../marker/trait.Copy.html
207
+ /// [`write`]: fn.write.html
208
+ /// [`zero_memory`]: fn.zero_memory.html
209
+ /// [`copy_memory`]: fn.copy_memory.html
198
210
///
199
211
/// # Examples
200
212
///
0 commit comments