diff options
| author | blitzerr <rusty.blitzerr@gmail.com> | 2020-09-22 06:22:02 -0700 |
|---|---|---|
| committer | blitzerr <rusty.blitzerr@gmail.com> | 2020-09-22 06:22:02 -0700 |
| commit | 3ffd403c6b97f181c189a8eb5fbd30e3e7a95b43 (patch) | |
| tree | 23200238b60848d20c1e78f486c97fdbcce997ff /library/alloc/src | |
| parent | 219003bd2ee6778333cf92405c6ea8591ecc8816 (diff) | |
| download | rust-3ffd403c6b97f181c189a8eb5fbd30e3e7a95b43.tar.gz rust-3ffd403c6b97f181c189a8eb5fbd30e3e7a95b43.zip | |
removing &mut self for other methods of AllocRef
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/alloc.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/raw_vec.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/raw_vec/tests.rs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/library/alloc/src/alloc.rs b/library/alloc/src/alloc.rs index 7d872b1a66b..462bcd15fa9 100644 --- a/library/alloc/src/alloc.rs +++ b/library/alloc/src/alloc.rs @@ -213,12 +213,12 @@ unsafe impl AllocRef for Global { } #[inline] - fn alloc_zeroed(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { + fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> { self.alloc_impl(layout, true) } #[inline] - unsafe fn dealloc(&mut self, ptr: NonNull<u8>, layout: Layout) { + unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout) { if layout.size() != 0 { // SAFETY: `layout` is non-zero in size, // other conditions must be upheld by the caller diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs index 62675665f03..5b4a4957f6c 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec.rs @@ -169,7 +169,7 @@ impl<T, A: AllocRef> RawVec<T, A> { Self::allocate_in(capacity, AllocInit::Zeroed, alloc) } - fn allocate_in(capacity: usize, init: AllocInit, mut alloc: A) -> Self { + fn allocate_in(capacity: usize, init: AllocInit, alloc: A) -> Self { if mem::size_of::<T>() == 0 { Self::new_in(alloc) } else { diff --git a/library/alloc/src/raw_vec/tests.rs b/library/alloc/src/raw_vec/tests.rs index 2ed9d3685c6..e4c8b3709df 100644 --- a/library/alloc/src/raw_vec/tests.rs +++ b/library/alloc/src/raw_vec/tests.rs @@ -34,7 +34,7 @@ fn allocator_param() { err @ Err(_) => err, } } - unsafe fn dealloc(&mut self, ptr: NonNull<u8>, layout: Layout) { + unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout) { unsafe { Global.dealloc(ptr, layout) } } } |
