@@ -200,6 +200,7 @@ pub fn construct<'a,'tcx>(hir: Cx<'a,'tcx>,
200200 CodeExtentData :: ParameterScope { fn_id : fn_id, body_id : body_id } ) ;
201201 unpack ! ( block = builder. in_scope( arg_extent, block, |builder, arg_scope_id| {
202202 arg_decls = Some ( unpack!( block = builder. args_and_body( block,
203+ return_ty,
203204 implicit_arguments,
204205 explicit_arguments,
205206 arg_scope_id,
@@ -268,6 +269,7 @@ pub fn construct<'a,'tcx>(hir: Cx<'a,'tcx>,
268269impl < ' a , ' tcx > Builder < ' a , ' tcx > {
269270 fn args_and_body ( & mut self ,
270271 mut block : BasicBlock ,
272+ return_ty : FnOutput < ' tcx > ,
271273 implicit_arguments : Vec < Ty < ' tcx > > ,
272274 explicit_arguments : Vec < ( Ty < ' tcx > , & ' tcx hir:: Pat ) > ,
273275 argument_scope_id : ScopeId ,
@@ -313,8 +315,14 @@ impl<'a,'tcx> Builder<'a,'tcx> {
313315 } )
314316 . collect ( ) ;
315317
318+ // FIXME(#32959): temporary hack for the issue at hand
319+ let return_is_unit = if let FnOutput :: FnConverging ( t) = return_ty {
320+ t. is_nil ( )
321+ } else {
322+ false
323+ } ;
316324 // start the first basic block and translate the body
317- unpack ! ( block = self . ast_block( & Lvalue :: ReturnPointer , block, ast_block) ) ;
325+ unpack ! ( block = self . ast_block( & Lvalue :: ReturnPointer , return_is_unit , block, ast_block) ) ;
318326
319327 block. and ( arg_decls)
320328 }
0 commit comments