Skip to content

Error message for wrong number of arguments to a closure is bad #21857

Closed
@nrc

Description

@nrc

For example: error: type mismatch: the type `[closure /home/ncameron/rust3/src/librustc_driver/lib.rs:107:36: 107:44]` implements the trait `for<'r> core::ops::Fn<(&'r rustc::session::Session,)>`, but the trait `for<'r,'r> core::ops::Fn<(&'r rustc::session::Session, &'r getopts::Matches)>` is required (expected a tuple with 2 elements, found one with 1 elements)

It should talk about arguments rather than tuples, it should also be multi-line. It probably doesn't need to talk about the Fn trait at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-closuresArea: Closures (`|…| { … }`)A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions