Skip to content

Parameter cardinality error has a terrible span. #13684

Closed
@SiegeLord

Description

@SiegeLord

E.g.:

fn main()
{
    range(0, 5).take();
    range(0, 5)
    .take();
}

Gives this error:

test.rs:3:2: 3:20 error: this function takes 1 parameter but 0 parameters were supplied
test.rs:3       range(0, 5).take();
                ^~~~~~~~~~~~~~~~~~
test.rs:4:2: 5:9 error: this function takes 1 parameter but 0 parameters were supplied
test.rs:4       range(0, 5)
test.rs:5       .take();
error: aborting due to 2 previous errors

Both are quite terrible and require going through each function to figure out which one has the wrong number of arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions