Skip to content

Generate function invalid closure parameter #21288

@A4-Tacks

Description

@A4-Tacks

rust-analyzer version: master

rustc version: rustc 1.93.0-nightly (f15a7f385 2025-11-04)

editor or extension: VIM9.1 coc-rust-analyzer-0.82.0

Strangely, I am unable to reproduce in the test-utils

code snippet to reproduce:

fn foo() {
    $0bar(&|x| true)
}

Expect:

fn foo() {
    bar(&|x| true)
}

fn bar(arg: impl Fn(_) -> bool) {
    todo!()
}

Actual:

fn foo() {
    bar(&|x| true)
}

fn bar(arg: impl Fn(;)) {
    todo!()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions