Skip to content

Commit 3370ac0

Browse files
authored
Rollup merge of #75151 - pickfire:patch-4, r=LukasKalbertodt
Consistent variable name alloc for raw_vec
2 parents dde4fb3 + e1ef3fa commit 3370ac0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

library/alloc/src/raw_vec.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,15 @@ impl<T, A: AllocRef> RawVec<T, A> {
203203
///
204204
/// # Safety
205205
///
206-
/// The `ptr` must be allocated (via the given allocator `a`), and with the given `capacity`.
206+
/// The `ptr` must be allocated (via the given allocator `alloc`), and with the given
207+
/// `capacity`.
207208
/// The `capacity` cannot exceed `isize::MAX` for sized types. (only a concern on 32-bit
208209
/// systems). ZST vectors may have a capacity up to `usize::MAX`.
209-
/// If the `ptr` and `capacity` come from a `RawVec` created via `a`, then this is guaranteed.
210+
/// If the `ptr` and `capacity` come from a `RawVec` created via `alloc`, then this is
211+
/// guaranteed.
210212
#[inline]
211-
pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, a: A) -> Self {
212-
Self { ptr: unsafe { Unique::new_unchecked(ptr) }, cap: capacity, alloc: a }
213+
pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, alloc: A) -> Self {
214+
Self { ptr: unsafe { Unique::new_unchecked(ptr) }, cap: capacity, alloc }
213215
}
214216

215217
/// Gets a raw pointer to the start of the allocation. Note that this is

0 commit comments

Comments
 (0)