@@ -1201,8 +1201,6 @@ pub trait OwnedVector<T> {
1201
1201
fn shrink_to_fit ( & mut self ) ;
1202
1202
1203
1203
fn push ( & mut self , t : T ) ;
1204
- unsafe fn push_fast ( & mut self , t : T ) ;
1205
-
1206
1204
fn push_all_move ( & mut self , rhs : ~[ T ] ) ;
1207
1205
fn pop ( & mut self ) -> T ;
1208
1206
fn pop_opt ( & mut self ) -> Option < T > ;
@@ -1334,7 +1332,7 @@ impl<T> OwnedVector<T> for ~[T] {
1334
1332
self . reserve_at_least ( new_len) ;
1335
1333
}
1336
1334
1337
- self . push_fast ( t) ;
1335
+ push_fast ( self , t) ;
1338
1336
} else {
1339
1337
let repr: * * Vec < ( ) > = cast:: transmute ( & mut * self ) ;
1340
1338
let fill = ( * * repr) . fill ;
@@ -1343,29 +1341,30 @@ impl<T> OwnedVector<T> for ~[T] {
1343
1341
self . reserve_at_least ( new_len) ;
1344
1342
}
1345
1343
1346
- self . push_fast ( t) ;
1344
+ push_fast ( self , t) ;
1347
1345
}
1348
1346
}
1349
- }
1350
1347
1351
- // This doesn't bother to make sure we have space.
1352
- #[ inline] // really pretty please
1353
- unsafe fn push_fast ( & mut self , t : T ) {
1354
- if contains_managed :: < T > ( ) {
1355
- let repr: * * mut Box < Vec < u8 > > = cast:: transmute ( self ) ;
1356
- let fill = ( * * repr) . data . fill ;
1357
- ( * * repr) . data . fill += sys:: nonzero_size_of :: < T > ( ) ;
1358
- let p = to_unsafe_ptr ( & ( ( * * repr) . data . data ) ) ;
1359
- let p = ptr:: offset ( p, fill as int ) as * mut T ;
1360
- intrinsics:: move_val_init ( & mut ( * p) , t) ;
1361
- } else {
1362
- let repr: * * mut Vec < u8 > = cast:: transmute ( self ) ;
1363
- let fill = ( * * repr) . fill ;
1364
- ( * * repr) . fill += sys:: nonzero_size_of :: < T > ( ) ;
1365
- let p = to_unsafe_ptr ( & ( ( * * repr) . data ) ) ;
1366
- let p = ptr:: offset ( p, fill as int ) as * mut T ;
1367
- intrinsics:: move_val_init ( & mut ( * p) , t) ;
1348
+ // This doesn't bother to make sure we have space.
1349
+ #[ inline] // really pretty please
1350
+ unsafe fn push_fast < T > ( this : & mut ~[ T ] , t : T ) {
1351
+ if contains_managed :: < T > ( ) {
1352
+ let repr: * * mut Box < Vec < u8 > > = cast:: transmute ( this) ;
1353
+ let fill = ( * * repr) . data . fill ;
1354
+ ( * * repr) . data . fill += sys:: nonzero_size_of :: < T > ( ) ;
1355
+ let p = to_unsafe_ptr ( & ( ( * * repr) . data . data ) ) ;
1356
+ let p = ptr:: offset ( p, fill as int ) as * mut T ;
1357
+ intrinsics:: move_val_init ( & mut ( * p) , t) ;
1358
+ } else {
1359
+ let repr: * * mut Vec < u8 > = cast:: transmute ( this) ;
1360
+ let fill = ( * * repr) . fill ;
1361
+ ( * * repr) . fill += sys:: nonzero_size_of :: < T > ( ) ;
1362
+ let p = to_unsafe_ptr ( & ( ( * * repr) . data ) ) ;
1363
+ let p = ptr:: offset ( p, fill as int ) as * mut T ;
1364
+ intrinsics:: move_val_init ( & mut ( * p) , t) ;
1365
+ }
1368
1366
}
1367
+
1369
1368
}
1370
1369
1371
1370
/// Takes ownership of the vector `rhs`, moving all elements into
0 commit comments