@@ -507,23 +507,6 @@ impl<'blk, 'tcx> CleanupMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx> {
507
507
self . schedule_clean ( cleanup_scope, drop as CleanupObj ) ;
508
508
}
509
509
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
-
527
510
fn schedule_clean ( & self ,
528
511
cleanup_scope : ScopeId ,
529
512
cleanup : CleanupObj < ' tcx > ) {
@@ -1106,43 +1089,6 @@ impl<'tcx> Cleanup<'tcx> for FreeValue<'tcx> {
1106
1089
}
1107
1090
}
1108
1091
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
-
1146
1092
#[ derive( Copy , Clone ) ]
1147
1093
pub struct LifetimeEnd {
1148
1094
ptr : ValueRef ,
@@ -1253,12 +1199,6 @@ pub trait CleanupMethods<'blk, 'tcx> {
1253
1199
val : ValueRef ,
1254
1200
heap : Heap ,
1255
1201
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 ) ;
1262
1202
fn schedule_clean ( & self ,
1263
1203
cleanup_scope : ScopeId ,
1264
1204
cleanup : CleanupObj < ' tcx > ) ;
0 commit comments