@@ -89,13 +89,11 @@ impl fmt::Display for AllocError {
89
89
pub unsafe trait AllocRef {
90
90
/// Attempts to allocate a block of memory.
91
91
///
92
- /// On success, returns a [`NonNull<[u8]>`] meeting the size and alignment guarantees of `layout`.
92
+ /// On success, returns a [`NonNull<[u8]>`][NonNull] meeting the size and alignment guarantees of `layout`.
93
93
///
94
94
/// The returned block may have a larger size than specified by `layout.size()`, and may or may
95
95
/// not have its contents initialized.
96
96
///
97
- /// [`NonNull<[u8]>`]: NonNull
98
- ///
99
97
/// # Errors
100
98
///
101
99
/// Returning `Err` indicates that either memory is exhausted or `layout` does not meet
@@ -146,7 +144,7 @@ pub unsafe trait AllocRef {
146
144
147
145
/// Attempts to extend the memory block.
148
146
///
149
- /// Returns a new [`NonNull<[u8]>`] containing a pointer and the actual size of the allocated
147
+ /// Returns a new [`NonNull<[u8]>`][NonNull] containing a pointer and the actual size of the allocated
150
148
/// memory. The pointer is suitable for holding data described by `new_layout`. To accomplish
151
149
/// this, the allocator may extend the allocation referenced by `ptr` to fit the new layout.
152
150
///
@@ -158,8 +156,6 @@ pub unsafe trait AllocRef {
158
156
/// If this method returns `Err`, then ownership of the memory block has not been transferred to
159
157
/// this allocator, and the contents of the memory block are unaltered.
160
158
///
161
- /// [`NonNull<[u8]>`]: NonNull
162
- ///
163
159
/// # Safety
164
160
///
165
161
/// * `ptr` must denote a block of memory [*currently allocated*] via this allocator.
@@ -271,7 +267,7 @@ pub unsafe trait AllocRef {
271
267
272
268
/// Attempts to shrink the memory block.
273
269
///
274
- /// Returns a new [`NonNull<[u8]>`] containing a pointer and the actual size of the allocated
270
+ /// Returns a new [`NonNull<[u8]>`][NonNull] containing a pointer and the actual size of the allocated
275
271
/// memory. The pointer is suitable for holding data described by `new_layout`. To accomplish
276
272
/// this, the allocator may shrink the allocation referenced by `ptr` to fit the new layout.
277
273
///
@@ -283,8 +279,6 @@ pub unsafe trait AllocRef {
283
279
/// If this method returns `Err`, then ownership of the memory block has not been transferred to
284
280
/// this allocator, and the contents of the memory block are unaltered.
285
281
///
286
- /// [`NonNull<[u8]>`]: NonNull
287
- ///
288
282
/// # Safety
289
283
///
290
284
/// * `ptr` must denote a block of memory [*currently allocated*] via this allocator.
0 commit comments