about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIvan Tham <pickfire@riseup.net>2020-08-04 23:46:14 +0800
committerGitHub <noreply@github.com>2020-08-04 23:46:14 +0800
commite1ef3fa686040a8c9aba34dd954a7ff7227a23ee (patch)
treef91d78a9ce09696c2e3e4a3af94f7cfa0f1d3656
parent5f6bd6ec0ac422991b89bb8643eaa5d9d46eed11 (diff)
downloadrust-e1ef3fa686040a8c9aba34dd954a7ff7227a23ee.tar.gz
rust-e1ef3fa686040a8c9aba34dd954a7ff7227a23ee.zip
Consistent variable name alloc for raw_vec
-rw-r--r--library/alloc/src/raw_vec.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index 99ac027bf0b..f403035ec40 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -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