Skip to content

Commit b837bb2

Browse files
committed
rustc_codegen_ssa: bug on tail calls
1 parent c034362 commit b837bb2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/analyze.rs

+1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ pub fn cleanup_kinds(mir: &mir::Body<'_>) -> IndexVec<mir::BasicBlock, CleanupKi
292292
| TerminatorKind::SwitchInt { .. }
293293
| TerminatorKind::Yield { .. }
294294
| TerminatorKind::FalseEdge { .. }
295+
| TerminatorKind::TailCall { .. }
295296
| TerminatorKind::FalseUnwind { .. } => { /* nothing to do */ }
296297
TerminatorKind::Call { unwind, .. }
297298
| TerminatorKind::InlineAsm { unwind, .. }

compiler/rustc_codegen_ssa/src/mir/block.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,15 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
12941294
fn_span,
12951295
mergeable_succ(),
12961296
),
1297+
1298+
mir::TerminatorKind::TailCall { .. } => {
1299+
// FIXME(explicit_tail_calls): implement tail calls in ssa backend
1300+
span_bug!(
1301+
terminator.source_info.span,
1302+
"`TailCall` terminator is not yet supported by `rustc_codegen_ssa`"
1303+
)
1304+
}
1305+
12971306
mir::TerminatorKind::GeneratorDrop | mir::TerminatorKind::Yield { .. } => {
12981307
bug!("generator ops in codegen")
12991308
}

0 commit comments

Comments
 (0)