@@ -172,7 +172,7 @@ pub fn allocate_cbox(bcx: @mut Block, sigil: ast::Sigil, cdata_ty: ty::t)
172172 // Allocate and initialize the box:
173173 match sigil {
174174 ast:: ManagedSigil => {
175- malloc_raw ( bcx , cdata_ty , heap_managed )
175+ tcx . sess . bug ( "trying to trans allocation of @fn" )
176176 }
177177 ast:: OwnedSigil => {
178178 malloc_raw ( bcx, cdata_ty, heap_for_unique_closure ( bcx, cdata_ty) )
@@ -197,7 +197,8 @@ pub struct ClosureResult {
197197// Otherwise, it is stack allocated and copies pointers to the upvars.
198198pub fn store_environment ( bcx : @mut Block ,
199199 bound_values : ~[ EnvValue ] ,
200- sigil : ast:: Sigil ) -> ClosureResult {
200+ sigil : ast:: Sigil )
201+ -> ClosureResult {
201202 let _icx = push_ctxt ( "closure::store_environment" ) ;
202203 let ccx = bcx. ccx ( ) ;
203204 let tcx = ccx. tcx ;
@@ -444,27 +445,6 @@ pub fn make_closure_glue(
444445 }
445446}
446447
447- pub fn make_opaque_cbox_take_glue (
448- bcx : @mut Block ,
449- sigil : ast:: Sigil ,
450- cboxptr : ValueRef ) // ptr to ptr to the opaque closure
451- -> @mut Block {
452- // Easy cases:
453- let _icx = push_ctxt ( "closure::make_opaque_cbox_take_glue" ) ;
454- match sigil {
455- ast:: BorrowedSigil => {
456- return bcx;
457- }
458- ast:: ManagedSigil => {
459- glue:: incr_refcnt_of_boxed ( bcx, Load ( bcx, cboxptr) ) ;
460- return bcx;
461- }
462- ast:: OwnedSigil => {
463- fail ! ( "unique closures are not copyable" )
464- }
465- }
466- }
467-
468448pub fn make_opaque_cbox_drop_glue (
469449 bcx : @mut Block ,
470450 sigil : ast:: Sigil ,
@@ -474,9 +454,7 @@ pub fn make_opaque_cbox_drop_glue(
474454 match sigil {
475455 ast:: BorrowedSigil => bcx,
476456 ast:: ManagedSigil => {
477- glue:: decr_refcnt_maybe_free (
478- bcx, Load ( bcx, cboxptr) , Some ( cboxptr) ,
479- ty:: mk_opaque_closure_ptr ( bcx. tcx ( ) , sigil) )
457+ bcx. tcx ( ) . sess . bug ( "trying to trans drop glue of @fn" )
480458 }
481459 ast:: OwnedSigil => {
482460 glue:: free_ty (
@@ -516,12 +494,8 @@ pub fn make_opaque_cbox_free_glue(
516494 abi:: tydesc_field_drop_glue, None ) ;
517495
518496 // Free the ty descr (if necc) and the box itself
519- match sigil {
520- ast:: ManagedSigil => glue:: trans_free ( bcx, cbox) ,
521- ast:: OwnedSigil => glue:: trans_exchange_free ( bcx, cbox) ,
522- ast:: BorrowedSigil => {
523- bcx. sess ( ) . bug ( "impossible" )
524- }
525- }
497+ glue:: trans_exchange_free ( bcx, cbox) ;
498+
499+ bcx
526500 }
527501}
0 commit comments