@@ -680,7 +680,7 @@ impl<A: Allocator> RawVecInner<A> {
680680
681681 // SAFETY: Precondition passed to caller
682682 let ptr =
683- finish_grow ( new_layout, unsafe { self . current_memory ( elem_layout) } , & mut self . alloc ) ?;
683+ unsafe { finish_grow ( new_layout, self . current_memory ( elem_layout) , & mut self . alloc ) ? } ;
684684 // SAFETY: finish_grow would have resulted in a capacity overflow if we tried to allocate more than `isize::MAX` items
685685
686686 unsafe { self . set_ptr_and_cap ( ptr, cap) } ;
@@ -704,7 +704,7 @@ impl<A: Allocator> RawVecInner<A> {
704704
705705 // SAFETY: Precondition passed to caller
706706 let ptr =
707- finish_grow ( new_layout, unsafe { self . current_memory ( elem_layout) } , & mut self . alloc ) ?;
707+ unsafe { finish_grow ( new_layout, self . current_memory ( elem_layout) , & mut self . alloc ) ? } ;
708708 // SAFETY: finish_grow would have resulted in a capacity overflow if we tried to allocate more than `isize::MAX` items
709709 unsafe {
710710 self . set_ptr_and_cap ( ptr, cap) ;
@@ -789,7 +789,7 @@ impl<A: Allocator> RawVecInner<A> {
789789// not marked inline(never) since we want optimizers to be able to observe the specifics of this
790790// function, see tests/codegen-llvm/vec-reserve-extend.rs.
791791#[ cold]
792- fn finish_grow < A > (
792+ unsafe fn finish_grow < A > (
793793 new_layout : Layout ,
794794 current_memory : Option < ( NonNull < u8 > , Layout ) > ,
795795 alloc : & mut A ,
0 commit comments