Skip to content

unhelpful error message invoking fn foo<T>() when T is not used within signature #28523

Closed
@whitequark

Description

@whitequark

Test case:

fn foo<T>() {}
fn main() { foo() }

Error:

t.rs:2:13: 2:16 error: unable to infer enough type information about `_`; type annotations or generic parameter binding required [E0282]
t.rs:2 fn main() { foo() }
                   ^~~

It should, at least, mention T by name, and I think some rewording would also be beneficial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions