Skip to content

Commit

Permalink
Rollup merge of #75151 - pickfire:patch-4, r=LukasKalbertodt
Browse files Browse the repository at this point in the history
Consistent variable name alloc for raw_vec
  • Loading branch information
JohnTitor authored Aug 8, 2020
2 parents dde4fb3 + e1ef3fa commit 3370ac0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions library/alloc/src/raw_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,15 @@ impl<T, A: AllocRef> RawVec<T, A> {
///
/// # Safety
///
/// The `ptr` must be allocated (via the given allocator `a`), and with the given `capacity`.
/// The `ptr` must be allocated (via the given allocator `alloc`), and with the given
/// `capacity`.
/// The `capacity` cannot exceed `isize::MAX` for sized types. (only a concern on 32-bit
/// systems). ZST vectors may have a capacity up to `usize::MAX`.
/// If the `ptr` and `capacity` come from a `RawVec` created via `a`, then this is guaranteed.
/// If the `ptr` and `capacity` come from a `RawVec` created via `alloc`, then this is
/// guaranteed.
#[inline]
pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, a: A) -> Self {
Self { ptr: unsafe { Unique::new_unchecked(ptr) }, cap: capacity, alloc: a }
pub unsafe fn from_raw_parts_in(ptr: *mut T, capacity: usize, alloc: A) -> Self {
Self { ptr: unsafe { Unique::new_unchecked(ptr) }, cap: capacity, alloc }
}

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

0 comments on commit 3370ac0

Please sign in to comment.