Skip to content

Commit 80a75d3

Browse files
committed
rustc_codegen_cranelift: bug on tail calls
1 parent fcfee26 commit 80a75d3

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
@@ -441,6 +441,11 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
441441
)
442442
});
443443
}
444+
// FIXME(explicit_tail_calls): add support for tail calls to the cranelift backend, once cranelift supports tail calls
445+
TerminatorKind::TailCall { fn_span, .. } => span_bug!(
446+
*fn_span,
447+
"tail calls are not yet supported in `rustc_codegen_cranelift` backend"
448+
),
444449
TerminatorKind::InlineAsm {
445450
template,
446451
operands,

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
539539
{
540540
return None;
541541
}
542+
TerminatorKind::TailCall { .. } => return None,
542543
TerminatorKind::Call { .. } => {}
543544
}
544545
}

0 commit comments

Comments
 (0)