Skip to content

tail call diagnostics omit lifetimes #144957

@WaffleLapkin

Description

@WaffleLapkin

Code

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

fn foo<'a>(_: fn(&'a ())) {
    become bar(dummy);
}

fn bar(_: fn(&())) {}

fn dummy(_: &()) {}

fn main() {}

Current output

error: mismatched signatures
 --> src/main.rs:5:5
  |
5 |     become bar(dummy);
  |     ^^^^^^^^^^^^^^^^^
  |
  = note: `become` requires caller and callee to have matching signatures
  = note: caller signature: `fn(fn(&()))`
  = note: callee signature: `fn(for<'a> fn(&'a ()))`

Desired output

error: mismatched signatures
 --> src/main.rs:5:5
  |
5 |     become bar(dummy);
  |     ^^^^^^^^^^^^^^^^^
  |
  = note: `become` requires caller and callee to have matching signatures
  = note: caller signature: `fn(fn(&'a ()))`
  = note: callee signature: `fn(for<'a> fn(&'a ()))`

Rust Version

1.91.0-nightly (2025-08-04 0060d5a2a8a86a31f629)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsF-explicit_tail_calls`#![feature(explicit_tail_calls)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-incomplete-featuresThis issue requires the use of incomplete features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions