Skip to content

Compiler panic on explicit tail calls (become) #5131

Closed

Description

@feliperodri

The compiler panics on explicit tail calls (become, feature explicit_tail_calls), inside rustc_public.

#![feature(explicit_tail_calls)]
#![allow(incomplete_features)]

fn g(x: u32) -> u32 {
    x + 1
}

fn f(x: u32) -> u32 {
    become g(x)
}

#[kani::proof]
fn tail_call() {
    assert_eq!(f(1), 2);
}
thread 'rustc' panicked at .../compiler/rustc_public/src/unstable/convert/stable/mir.rs:775:79:
not implemented

rustc_public doesn't convert the TailCall terminator. The feature is unstable and incomplete, so a clear "unsupported" error would do for now. Found with Miri's fail/tail_calls/dangling-local-var.rs. Kani 0.68.0 at main (47689dc), CBMC 6.11.0.

Activity

  1. added theissue type on Nov 6, 2026
  2. mvanhorn commented on Nov 11, 2026

    @mvanhorn
    Contributor

    rustc_public has no TailCall terminator variant, so converting a body containing one reaches unimplemented!(). Kani loaded these bodies without checking for explicit tail calls first.

    The diff checks internal MIR before body conversion during transformation, proof metadata generation, and autoharness processing, including instantiation search. It reports each explicit tail call in the body at its source span and aborts with an unsupported-feature diagnostic.

    #5152

  3. added a commit that references this issue on Nov 13, 2026
    7f89576
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions