@@ -870,7 +870,7 @@ impl<'bump, T: 'bump> Vec<'bump, T> {
870
870
unsafe {
871
871
let ptr = self . as_ptr ( ) ;
872
872
let len = self . len ( ) ;
873
- mem:: forget ( self ) ;
873
+ // Don't need ` mem::forget(self)` here, because `Vec` does not implement `Drop`.
874
874
slice:: from_raw_parts ( ptr, len)
875
875
}
876
876
}
@@ -895,7 +895,7 @@ impl<'bump, T: 'bump> Vec<'bump, T> {
895
895
pub fn into_bump_slice_mut ( mut self ) -> & ' bump mut [ T ] {
896
896
let ptr = self . as_mut_ptr ( ) ;
897
897
let len = self . len ( ) ;
898
- mem:: forget ( self ) ;
898
+ // Don't need ` mem::forget(self)` here, because `Vec` does not implement `Drop`.
899
899
900
900
unsafe { slice:: from_raw_parts_mut ( ptr, len) }
901
901
}
@@ -2244,7 +2244,7 @@ impl<'bump, T: 'bump> IntoIterator for Vec<'bump, T> {
2244
2244
} else {
2245
2245
begin. add ( self . len ( ) ) as * const T
2246
2246
} ;
2247
- mem:: forget ( self ) ;
2247
+ // Don't need ` mem::forget(self)` here, because `Vec` does not implement `Drop`.
2248
2248
IntoIter { phantom : PhantomData , ptr : begin, end }
2249
2249
}
2250
2250
}
@@ -2453,18 +2453,6 @@ impl<'bump, T: 'bump> BorrowMut<[T]> for Vec<'bump, T> {
2453
2453
}
2454
2454
}
2455
2455
2456
- impl < ' bump , T > Drop for Vec < ' bump , T > {
2457
- fn drop ( & mut self ) {
2458
- unsafe {
2459
- // use drop for [T]
2460
- // use a raw slice to refer to the elements of the vector as weakest necessary type;
2461
- // could avoid questions of validity in certain cases
2462
- ptr:: drop_in_place ( ptr:: slice_from_raw_parts_mut ( self . as_mut_ptr ( ) , self . len ) )
2463
- }
2464
- // RawVec handles deallocation
2465
- }
2466
- }
2467
-
2468
2456
////////////////////////////////////////////////////////////////////////////////
2469
2457
// Clone-on-write
2470
2458
////////////////////////////////////////////////////////////////////////////////
0 commit comments