-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 does not show the warnings if executed twice #1495
Comments
The first one is a feature of And for the note: If you add a binary to a library crate you also need to update the |
How about adding this information in the docs?
I thinking that adding |
Sure!
You still need a |
You do not need extra sections. The file is compiled with |
If something is called |
The new built-in |
I think we could simply ensure that the build doesn't go through, then it needs to rebuild. But that might break once we get incremental compilation |
How new is that? % cargo check
Compiling zpeifnzepifn v0.1.0 (file:///tmp/zpeifnzepifn)
warning: function is never used: `it_works`, #[warn(dead_code)] on by default
--> src/lib.rs:1:1
|
1 | fn it_works() {
| _^ starting here...
2 | | let a = 32;
3 | | }
| |_^ ...ending here
warning: unused variable: `a`, #[warn(unused_variables)] on by default
--> src/lib.rs:2:9
|
2 | let a = 32;
| ^
Finished dev [unoptimized + debuginfo] target(s) in 0.6 secs
% cargo check
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
% cargo check
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
% cargo -V
cargo 0.17.0-nightly (67e4ef1 2017-01-25) |
@mcarton |
Looks like a bug in |
Opened rust-lang/cargo#3624 |
New Rust user here. I would like to second the initial comment of @malbarbo that running Also, running I think partly the problem is that the docs do not explain how/when clippy works. Is this a compiler step or something, or is it a binary that is just run over the source code and outputs warnings? I am going to open another issue about improving the docs. |
How to write warnings produced by cargo clippy in a file ? |
@KetkiT Like this:
Also please note this issue is closed and is not a support forum :). |
FWIW I just lost 30 minutes debugging this "feature" thinking there was a problem with my setup. It makes |
Why is this issue closed? Its still a problem. |
See #4612 This is now fixed in nightly, when running with |
This should not be closed, it's still an issue. |
This is tracked in #4612 and is fixed on nightly, when executed with |
Interesting but relevant how? I consider an important bugfix like this to be landed when it is available in stable. NB: Regardless of this this option, another workaround would be to simply use a different compiler for clippy. |
No need to keep 2 issues open for the same bug.
This depends on
I don't see the point in implementing a workaround for a fixed bug. |
It's a usage workaround, not something that needs to be implemented. For a lot of projects using a different compiler to run clippy is a lot cheaper/quicker than the suggested |
Hm? What exactly do you mean by "different compilers"? This is a problem with the caching cargo does. |
The problem is that IDEs/editors will automatically run
That's what I'm doing all the time because essentially it's much faster than a clean build. It's also faster than running clippy in release mode which would also work.
|
That wouldn't solve the problem, since executing |
It does As the name workaound implies, it's a working around a deficiency which is described in this issue. |
In my project, I found that (with the latest cargo 1.49.0 stable) both EDIT: I think this is already documented at #4612 . |
I would expect that the warnings to be shown again... If this is a feature, I think something must be write in the docs.
Note that adding a binary and running
cargo clippy
again does not show the warning in lib:The text was updated successfully, but these errors were encountered: