Skip to content

Commit 0ace4e6

Browse files
committed
rustc_codegen_cranelift: bug on tail calls
1 parent 20c26dc commit 0ace4e6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/rustc_codegen_cranelift/src/base.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,11 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
433433
)
434434
});
435435
}
436+
// FIXME(explicit_tail_calls): add support for tail calls to the cranelift backend, once cranelift supports tail calls
437+
TerminatorKind::TailCall { fn_span, .. } => span_bug!(
438+
*fn_span,
439+
"tail calls are not yet supported in `rustc_codegen_cranelift` backend"
440+
),
436441
TerminatorKind::InlineAsm {
437442
template,
438443
operands,

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
566566
{
567567
return None;
568568
}
569+
TerminatorKind::TailCall { .. } => return None,
569570
TerminatorKind::Call { .. } => {}
570571
}
571572
}

0 commit comments

Comments
 (0)