Skip to content

Can't explicit tail call with HRTB argument #144826

@theemathas

Description

@theemathas

I tried this code:

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

fn foo(x: fn(&i32)) {
    become bar(x);
}

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

I expected the code to compile, but I got this error:

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

@rustbot labels +F-explicit_tail_calls +requires-incomplete-features

Meta

Reproducible on the playground with version 1.90.0-nightly (2025-08-01 4b55fe199cfe9c710555)

Metadata

Metadata

Labels

C-bugCategory: This is a bug.F-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