@@ -196,7 +196,7 @@ fn trans_struct_drop_flag<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
196196 let struct_data = if ty:: type_is_sized ( bcx. tcx ( ) , t) {
197197 v0
198198 } else {
199- let llval = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_base ] ) ;
199+ let llval = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
200200 Load ( bcx, llval)
201201 } ;
202202 let drop_flag = unpack_datum ! ( bcx, adt:: trans_drop_flag_ptr( bcx, & * repr, struct_data) ) ;
@@ -237,8 +237,8 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
237237 let ( struct_data, info) = if ty:: type_is_sized ( bcx. tcx ( ) , t) {
238238 ( v0, None )
239239 } else {
240- let data = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_base ] ) ;
241- let info = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_len ] ) ;
240+ let data = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
241+ let info = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ;
242242 ( Load ( bcx, data) , Some ( Load ( bcx, info) ) )
243243 } ;
244244
@@ -255,14 +255,14 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
255255 // The dtor expects a fat pointer, so make one, even if we have to fake it.
256256 let boxed_ty = ty:: mk_open ( bcx. tcx ( ) , t) ;
257257 let scratch = datum:: rvalue_scratch_datum ( bcx, boxed_ty, "__fat_ptr_drop_self" ) ;
258- Store ( bcx, value, GEPi ( bcx, scratch. val , & [ 0 , abi:: slice_elt_base ] ) ) ;
258+ Store ( bcx, value, GEPi ( bcx, scratch. val , & [ 0 , abi:: FAT_PTR_ADDR ] ) ) ;
259259 Store ( bcx,
260260 // If we just had a thin pointer, make a fat pointer by sticking
261261 // null where we put the unsizing info. This works because t
262262 // is a sized type, so we will only unpack the fat pointer, never
263263 // use the fake info.
264264 info. unwrap_or ( C_null ( Type :: i8p ( bcx. ccx ( ) ) ) ) ,
265- GEPi ( bcx, scratch. val , & [ 0 , abi:: slice_elt_len ] ) ) ;
265+ GEPi ( bcx, scratch. val , & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
266266 PointerCast ( variant_cx, scratch. val , params[ 0 ] )
267267 } else {
268268 PointerCast ( variant_cx, value, params[ 0 ] )
@@ -280,8 +280,8 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
280280 } else {
281281 let boxed_ty = ty:: mk_open ( bcx. tcx ( ) , * ty) ;
282282 let scratch = datum:: rvalue_scratch_datum ( bcx, boxed_ty, "__fat_ptr_drop_field" ) ;
283- Store ( bcx, llfld_a, GEPi ( bcx, scratch. val , & [ 0 , abi:: slice_elt_base ] ) ) ;
284- Store ( bcx, info. unwrap ( ) , GEPi ( bcx, scratch. val , & [ 0 , abi:: slice_elt_len ] ) ) ;
283+ Store ( bcx, llfld_a, GEPi ( bcx, scratch. val , & [ 0 , abi:: FAT_PTR_ADDR ] ) ) ;
284+ Store ( bcx, info. unwrap ( ) , GEPi ( bcx, scratch. val , & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
285285 scratch. val
286286 } ;
287287 variant_cx. fcx . schedule_drop_mem ( cleanup:: CustomScope ( field_scope) ,
@@ -369,11 +369,11 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
369369 tvec:: make_drop_glue_unboxed ( bcx, v0, unit_ty, true )
370370 }
371371 ty:: ty_trait( ..) => {
372- let lluniquevalue = GEPi ( bcx, v0, & [ 0 , abi:: trt_field_box ] ) ;
372+ let lluniquevalue = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
373373 // Only drop the value when it is non-null
374374 let concrete_ptr = Load ( bcx, lluniquevalue) ;
375375 with_cond ( bcx, IsNotNull ( bcx, concrete_ptr) , |bcx| {
376- let dtor_ptr = Load ( bcx, GEPi ( bcx, v0, & [ 0 , abi:: trt_field_vtable ] ) ) ;
376+ let dtor_ptr = Load ( bcx, GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
377377 let dtor = Load ( bcx, dtor_ptr) ;
378378 Call ( bcx,
379379 dtor,
@@ -383,12 +383,12 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
383383 } )
384384 }
385385 ty:: ty_struct( ..) if !ty:: type_is_sized ( bcx. tcx ( ) , content_ty) => {
386- let llval = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_base ] ) ;
386+ let llval = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
387387 let llbox = Load ( bcx, llval) ;
388388 let not_null = IsNotNull ( bcx, llbox) ;
389389 with_cond ( bcx, not_null, |bcx| {
390390 let bcx = drop_ty ( bcx, v0, content_ty, None ) ;
391- let info = GEPi ( bcx, v0, & [ 0 , abi:: slice_elt_len ] ) ;
391+ let info = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ;
392392 let info = Load ( bcx, info) ;
393393 let ( llsize, llalign) = size_and_align_of_dst ( bcx, content_ty, info) ;
394394 trans_exchange_free_dyn ( bcx, llbox, llsize, llalign)
@@ -440,12 +440,12 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
440440 t,
441441 |bb, vv, tt| drop_ty ( bb, vv, tt, None ) ) ,
442442 ty:: ty_closure( ref f) if f. store == ty:: UniqTraitStore => {
443- let box_cell_v = GEPi ( bcx, v0, & [ 0 u, abi:: fn_field_box ] ) ;
443+ let box_cell_v = GEPi ( bcx, v0, & [ 0 u, abi:: FAT_PTR_EXTRA ] ) ;
444444 let env = Load ( bcx, box_cell_v) ;
445445 let env_ptr_ty = Type :: at_box ( bcx. ccx ( ) , Type :: i8 ( bcx. ccx ( ) ) ) . ptr_to ( ) ;
446446 let env = PointerCast ( bcx, env, env_ptr_ty) ;
447447 with_cond ( bcx, IsNotNull ( bcx, env) , |bcx| {
448- let dtor_ptr = GEPi ( bcx, env, & [ 0 u, abi:: box_field_drop_glue ] ) ;
448+ let dtor_ptr = GEPi ( bcx, env, & [ 0 u, abi:: BOX_FIELD_DROP_GLUE ] ) ;
449449 let dtor = Load ( bcx, dtor_ptr) ;
450450 Call ( bcx, dtor, & [ PointerCast ( bcx, box_cell_v, Type :: i8p ( bcx. ccx ( ) ) ) ] , None ) ;
451451 bcx
@@ -456,8 +456,8 @@ fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, t: Ty<'tcx>)
456456 // above), because this happens for a trait field in an unsized
457457 // struct. If anything is null, it is the whole struct and we won't
458458 // get here.
459- let lluniquevalue = GEPi ( bcx, v0, & [ 0 , abi:: trt_field_box ] ) ;
460- let dtor_ptr = Load ( bcx, GEPi ( bcx, v0, & [ 0 , abi:: trt_field_vtable ] ) ) ;
459+ let lluniquevalue = GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_ADDR ] ) ;
460+ let dtor_ptr = Load ( bcx, GEPi ( bcx, v0, & [ 0 , abi:: FAT_PTR_EXTRA ] ) ) ;
461461 let dtor = Load ( bcx, dtor_ptr) ;
462462 Call ( bcx,
463463 dtor,
0 commit comments