Rollup merge of #76993 - blitzerr:alloc-ref, r=Amanieu

Changing the alloc() to accept &self instead of &mut self

Fixes: [#55](https://github.com/rust-lang/wg-allocators/issues/55)

This is the first cut. It only makes the change for `alloc` method.
This commit is contained in:
Dylan DPC 2020-09-23 14:54:06 +02:00 committed by GitHub
commit a40d79c9fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 46 deletions

View file

@ -170,7 +170,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 {