@@ -342,14 +342,14 @@ impl<'a, 'tcx> TerminatorCodegenHelper<'tcx> {
342
342
343
343
/// Codegen implementations for some terminator variants.
344
344
impl < ' a , ' tcx , Bx : BuilderMethods < ' a , ' tcx > > FunctionCx < ' a , ' tcx , Bx > {
345
- #[ allow( dead_code) ]
346
345
fn codegen_tail_call_terminator (
347
346
& mut self ,
348
347
bx : & mut Bx ,
349
348
func : & mir:: Operand < ' tcx > ,
350
349
args : & [ Spanned < mir:: Operand < ' tcx > > ] ,
351
350
fn_span : Span ,
352
- ) {
351
+ mergeable_succ : bool ,
352
+ ) -> MergingSucc {
353
353
// We don't need source_info as we already have fn_span for diagnostics
354
354
let func = self . codegen_operand ( bx, func) ;
355
355
let fn_ty = func. layout . ty ;
@@ -433,6 +433,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
433
433
434
434
// Return the result - musttail requires ret immediately after the call
435
435
bx. ret ( llret) ;
436
+
437
+ assert_eq ! ( mergeable_succ, false ) ;
438
+ MergingSucc :: False
436
439
}
437
440
438
441
/// Generates code for a `Resume` terminator.
@@ -1483,12 +1486,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
1483
1486
fn_span,
1484
1487
mergeable_succ ( ) ,
1485
1488
) ,
1486
- mir:: TerminatorKind :: TailCall { .. } => {
1487
- // FIXME(explicit_tail_calls): implement tail calls in ssa backend
1488
- span_bug ! (
1489
- terminator. source_info. span,
1490
- "`TailCall` terminator is not yet supported by `rustc_codegen_ssa`"
1491
- )
1489
+ mir:: TerminatorKind :: TailCall { ref func, ref args, fn_span } => {
1490
+ self . codegen_tail_call_terminator ( bx, func, args, fn_span, mergeable_succ ( ) )
1492
1491
}
1493
1492
mir:: TerminatorKind :: CoroutineDrop | mir:: TerminatorKind :: Yield { .. } => {
1494
1493
bug ! ( "coroutine ops in codegen" )
0 commit comments