@@ -200,6 +200,7 @@ pub fn construct<'a,'tcx>(hir: Cx<'a,'tcx>,
200
200
CodeExtentData :: ParameterScope { fn_id : fn_id, body_id : body_id } ) ;
201
201
unpack ! ( block = builder. in_scope( arg_extent, block, |builder, arg_scope_id| {
202
202
arg_decls = Some ( unpack!( block = builder. args_and_body( block,
203
+ return_ty,
203
204
implicit_arguments,
204
205
explicit_arguments,
205
206
arg_scope_id,
@@ -268,6 +269,7 @@ pub fn construct<'a,'tcx>(hir: Cx<'a,'tcx>,
268
269
impl < ' a , ' tcx > Builder < ' a , ' tcx > {
269
270
fn args_and_body ( & mut self ,
270
271
mut block : BasicBlock ,
272
+ return_ty : FnOutput < ' tcx > ,
271
273
implicit_arguments : Vec < Ty < ' tcx > > ,
272
274
explicit_arguments : Vec < ( Ty < ' tcx > , & ' tcx hir:: Pat ) > ,
273
275
argument_scope_id : ScopeId ,
@@ -313,8 +315,14 @@ impl<'a,'tcx> Builder<'a,'tcx> {
313
315
} )
314
316
. collect ( ) ;
315
317
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
+ } ;
316
324
// 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) ) ;
318
326
319
327
block. and ( arg_decls)
320
328
}
0 commit comments