Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zackw opened this issue May 13, 2019 · 1 comment
Open

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

zackw opened this issue May 13, 2019 · 1 comment

Comments

@zackw
Copy link

zackw commented May 13, 2019

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.

@GeeWee
Copy link

GeeWee commented Nov 16, 2023

Can confirm that it also seems like clippy fix will attempt to diagnose and fix the problem multiple times within one invocation with --all-targets, (if you recreate the issue right after it was fixed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants