Skip to content

cargo clippy --all-targets issues diagnostics for library crate twice #4092

Open
@zackw

Description

@zackw

Given a crate containing this file as src/lib.rs

pub fn demo() -> &'static str {
    return "demo";
}

and at least one file in tests that does use name_of_crate::demo, cargo clippy --all-targets will diagnose the needless_return twice in a row. If you use cargo --verbose it's clear that the clippy-driver program has been invoked twice (once with --test and once without) and each invocation is reporting the lint, but without that, it looks like clippy is repeating itself for no reason.

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