@@ -507,23 +507,6 @@ impl<'blk, 'tcx> CleanupMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx> {
507507 self . schedule_clean ( cleanup_scope, drop as CleanupObj ) ;
508508 }
509509
510- /// Schedules a call to `free(val)`. Note that this is a shallow operation.
511- fn schedule_free_slice ( & self ,
512- cleanup_scope : ScopeId ,
513- val : ValueRef ,
514- size : ValueRef ,
515- align : ValueRef ,
516- heap : Heap ) {
517- let drop = box FreeSlice { ptr : val, size : size, align : align, heap : heap } ;
518-
519- debug ! ( "schedule_free_slice({:?}, val={}, heap={:?})" ,
520- cleanup_scope,
521- self . ccx. tn( ) . val_to_string( val) ,
522- heap) ;
523-
524- self . schedule_clean ( cleanup_scope, drop as CleanupObj ) ;
525- }
526-
527510 fn schedule_clean ( & self ,
528511 cleanup_scope : ScopeId ,
529512 cleanup : CleanupObj < ' tcx > ) {
@@ -1106,43 +1089,6 @@ impl<'tcx> Cleanup<'tcx> for FreeValue<'tcx> {
11061089 }
11071090}
11081091
1109- #[ derive( Copy , Clone ) ]
1110- pub struct FreeSlice {
1111- ptr : ValueRef ,
1112- size : ValueRef ,
1113- align : ValueRef ,
1114- heap : Heap ,
1115- }
1116-
1117- impl < ' tcx > Cleanup < ' tcx > for FreeSlice {
1118- fn must_unwind ( & self ) -> bool {
1119- true
1120- }
1121-
1122- fn clean_on_unwind ( & self ) -> bool {
1123- true
1124- }
1125-
1126- fn is_lifetime_end ( & self ) -> bool {
1127- false
1128- }
1129-
1130- fn trans < ' blk > ( & self ,
1131- bcx : Block < ' blk , ' tcx > ,
1132- debug_loc : DebugLoc )
1133- -> Block < ' blk , ' tcx > {
1134- match self . heap {
1135- HeapExchange => {
1136- glue:: trans_exchange_free_dyn ( bcx,
1137- self . ptr ,
1138- self . size ,
1139- self . align ,
1140- debug_loc)
1141- }
1142- }
1143- }
1144- }
1145-
11461092#[ derive( Copy , Clone ) ]
11471093pub struct LifetimeEnd {
11481094 ptr : ValueRef ,
@@ -1253,12 +1199,6 @@ pub trait CleanupMethods<'blk, 'tcx> {
12531199 val : ValueRef ,
12541200 heap : Heap ,
12551201 content_ty : Ty < ' tcx > ) ;
1256- fn schedule_free_slice ( & self ,
1257- cleanup_scope : ScopeId ,
1258- val : ValueRef ,
1259- size : ValueRef ,
1260- align : ValueRef ,
1261- heap : Heap ) ;
12621202 fn schedule_clean ( & self ,
12631203 cleanup_scope : ScopeId ,
12641204 cleanup : CleanupObj < ' tcx > ) ;
0 commit comments