File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,10 @@ use std::mem;
1010use std :: ops :: {Deref , DerefMut };
1111use std :: marker :: PhantomData ;
1212use std :: alloc :: {
13- AllocInit ,
1413 AllocRef ,
1514 Global ,
1615 GlobalAlloc ,
1716 Layout ,
18- ReallocPlacement ,
1917 handle_alloc_error
2018};
2119
@@ -42,16 +40,14 @@ impl<T> RawVec<T> {
4240 assert! (elem_size != 0 , " capacity overflow" );
4341
4442 let (new_cap , ptr ) = if self . cap == 0 {
45- let ptr = Global . alloc (Layout :: array :: <T >(1 ). unwrap (), AllocInit :: Uninitialized );
43+ let ptr = Global . alloc (Layout :: array :: <T >(1 ). unwrap ());
4644 (1 , ptr )
4745 } else {
4846 let new_cap = 2 * self . cap;
4947 let c : NonNull <T > = self . ptr. into ();
5048 let ptr = Global . grow (c . cast (),
5149 Layout :: array :: <T >(self . cap). unwrap (),
52- Layout :: array :: <T >(new_cap ). unwrap (). size (),
53- ReallocPlacement :: MayMove ,
54- AllocInit :: Uninitialized );
50+ Layout :: array :: <T >(new_cap ). unwrap (). size ());
5551 (new_cap , ptr )
5652 };
5753
You can’t perform that action at this time.
0 commit comments