Skip to content

Commit d185b06

Browse files
committed
Fix SAFETY comments: finish_grow -> layout_array
1 parent 3b7fdb1 commit d185b06

File tree

1 file changed

+2
-2
lines changed
  • library/alloc/src/raw_vec

1 file changed

+2
-2
lines changed

library/alloc/src/raw_vec/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ impl<A: Allocator> RawVecInner<A> {
658658
let new_layout = layout_array(cap, elem_layout)?;
659659

660660
let ptr = finish_grow(new_layout, self.current_memory(elem_layout), &mut self.alloc)?;
661-
// SAFETY: finish_grow would have resulted in a capacity overflow if we tried to allocate more than `isize::MAX` items
661+
// SAFETY: layout_array would have resulted in a capacity overflow if we tried to allocate more than `isize::MAX` items
662662

663663
unsafe { self.set_ptr_and_cap(ptr, cap) };
664664
Ok(())
@@ -680,7 +680,7 @@ impl<A: Allocator> RawVecInner<A> {
680680
let new_layout = layout_array(cap, elem_layout)?;
681681

682682
let ptr = finish_grow(new_layout, self.current_memory(elem_layout), &mut self.alloc)?;
683-
// SAFETY: finish_grow would have resulted in a capacity overflow if we tried to allocate more than `isize::MAX` items
683+
// SAFETY: layout_array would have resulted in a capacity overflow if we tried to allocate more than `isize::MAX` items
684684
unsafe {
685685
self.set_ptr_and_cap(ptr, cap);
686686
}

0 commit comments

Comments
 (0)