cap() -> capacity() in newer RawVec
@@ -79,7 +79,7 @@ impl<T> TypedArenaChunk<T> {
// A pointer as large as possible for zero-sized elements.
!0 as *mut T
} else {
- self.start().add(self.storage.cap())
+ self.start().add(self.storage.capacity())
}
}
}
@@ -184,7 +184,7 @@ impl<T> TypedArena<T> {
self.end.set(last_chunk.end());
return;
} else {
- new_capacity = last_chunk.storage.cap();
+ new_capacity = last_chunk.storage.capacity();
loop {
new_capacity = new_capacity.checked_mul(2).unwrap();
if new_capacity >= currently_used_cap + n {
@@ -213,7 +213,7 @@ impl<T> TypedArena<T> {
let len = chunks_borrow.len();
// If `T` is ZST, code below has no effect.
for mut chunk in chunks_borrow.drain(..len - 1) {
- let cap = chunk.storage.cap();
+ let cap = chunk.storage.capacity();
chunk.destroy(cap);
}
}
@@ -256,7 +256,7 @@ unsafe impl<#[may_dangle] T> Drop for TypedArena<T> {
self.clear_last_chunk(&mut last_chunk);
// The last chunk will be dropped. Destroy all other chunks.
for chunk in chunks_borrow.iter_mut() {
- let cap = chunk.storage.cap();
+ let cap = chunk.storage.capacity();
chunk.destroy(cap);
}
}
@@ -324,7 +324,7 @@ impl DroplessArena {
self.end.set(last_chunk.end());
return;
} else {
- new_capacity = last_chunk.storage.cap();
+ new_capacity = last_chunk.storage.capacity();
loop {
new_capacity = new_capacity.checked_mul(2).unwrap();
if new_capacity >= used_bytes + needed_bytes {
