@@ -1320,7 +1320,7 @@ pub fn init_function<'a>(
13201320 }
13211321 } ;
13221322
1323- if !ty :: type_is_voidish ( fcx. ccx . tcx , substd_output_type) {
1323+ if !type_is_voidish ( fcx. ccx , substd_output_type) {
13241324 // If the function returns nil/bot, there is no real return
13251325 // value, so do not set `llretptr`.
13261326 if !skip_retptr || fcx. caller_expects_out_pointer {
@@ -1539,7 +1539,7 @@ pub fn trans_closure(ccx: @CrateContext,
15391539 // translation calls that don't have a return value (trans_crate,
15401540 // trans_mod, trans_item, et cetera) and those that do
15411541 // (trans_block, trans_expr, et cetera).
1542- if body. expr . is_none ( ) || ty :: type_is_voidish ( bcx. tcx ( ) , block_ty) {
1542+ if body. expr . is_none ( ) || type_is_voidish ( bcx. ccx ( ) , block_ty) {
15431543 bcx = controlflow:: trans_block ( bcx, body, expr:: Ignore ) ;
15441544 } else {
15451545 let dest = expr:: SaveIn ( fcx. llretptr . get ( ) . unwrap ( ) ) ;
@@ -1679,15 +1679,17 @@ fn trans_enum_variant_or_tuple_like_struct(ccx: @CrateContext,
16791679
16801680 let bcx = fcx. entry_bcx . get ( ) . unwrap ( ) ;
16811681
1682- let repr = adt:: represent_type ( ccx, result_ty) ;
1683- adt:: trans_start_init ( bcx, repr, fcx. llretptr . get ( ) . unwrap ( ) , disr) ;
1684- for ( i, arg_datum) in arg_datums. move_iter ( ) . enumerate ( ) {
1685- let lldestptr = adt:: trans_field_ptr ( bcx,
1686- repr,
1687- fcx. llretptr . get ( ) . unwrap ( ) ,
1688- disr,
1689- i) ;
1690- arg_datum. store_to ( bcx, lldestptr) ;
1682+ if !type_is_voidish ( fcx. ccx , result_ty) {
1683+ let repr = adt:: represent_type ( ccx, result_ty) ;
1684+ adt:: trans_start_init ( bcx, repr, fcx. llretptr . get ( ) . unwrap ( ) , disr) ;
1685+ for ( i, arg_datum) in arg_datums. move_iter ( ) . enumerate ( ) {
1686+ let lldestptr = adt:: trans_field_ptr ( bcx,
1687+ repr,
1688+ fcx. llretptr . get ( ) . unwrap ( ) ,
1689+ disr,
1690+ i) ;
1691+ arg_datum. store_to ( bcx, lldestptr) ;
1692+ }
16911693 }
16921694
16931695 finish_fn ( & fcx, bcx) ;
0 commit comments