Skip to content

Commit 9978261

Browse files
committed
Support tail calls in mir via TerminatorKind::TailCall
1 parent c6b883b commit 9978261

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/base.rs

+5
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,11 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
491491
)
492492
});
493493
}
494+
// FIXME(explicit_tail_calls): add support for tail calls to the cranelift backend, once cranelift supports tail calls
495+
TerminatorKind::TailCall { fn_span, .. } => span_bug!(
496+
*fn_span,
497+
"tail calls are not yet supported in `rustc_codegen_cranelift` backend"
498+
),
494499
TerminatorKind::InlineAsm {
495500
template,
496501
operands,

src/constant.rs

+1
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
565565
{
566566
return None;
567567
}
568+
TerminatorKind::TailCall { .. } => return None,
568569
TerminatorKind::Call { .. } => {}
569570
}
570571
}

0 commit comments

Comments
 (0)