TAIL_CALL_TRACK_CALLER in rustc_lint::builtin - Rust
Description: The `tail_call_track_caller` lint detects usage of `become` attempting to tail call a function marked with `#[track_caller]`.

Skip to main content

## TAIL_CALL_TRACK_CALLER

# Static TAIL_CALL_TRACK_CALLER

Source

    pub static TAIL_CALL_TRACK_CALLER: &'static Lint

Expand description

The `tail_call_track_caller` lint detects usage of `become` attempting to tail call a function marked with `#[track_caller]`.

#### §Example

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

    #[track_caller]
    fn f() {}

    fn g() {
        become f();
    }

    g();

{{produces}}

#### §Explanation

Due to implementation details of tail calls and `#[track_caller]` attribute, calls to functions marked with `#[track_caller]` cannot become tail calls. As such using `become` is no different than a normal call (except for changes in drop order).