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:
commit
a40d79c9fb
7 changed files with 48 additions and 46 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue