Skip to content

using unused arguments #3423

Closed
Closed
@jesse99

Description

@jesse99

Seems to me if an argument is marked unused (with an underscore) then there should be a warning or error if it is actually used. For example the below compiles and runs just fine:

// rustc --test ignores1.rs && ./ignores1
use std;

fn make_five(_x: int) -> int
{
    _x + 5
}

#[test]
fn tester()
{
    assert make_five(1) == 5
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions