Skip to content

Commit 3b5217b

Browse files
committed
rustc_codegen_ssa: bug on tail calls
1 parent 81b0084 commit 3b5217b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/analyze.rs

Lines changed: 1 addition & 0 deletions
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

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

0 commit comments

Comments
 (0)