Skip to content

Commit b3455d2

Browse files
committed
rustc_codegen_cranelift: bug on tail calls
1 parent b902f1f commit b3455d2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/rustc_codegen_cranelift/src/base.rs

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

compiler/rustc_codegen_cranelift/src/constant.rs

+1
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)