3

I wanted to use Clippy to lint my code using Rust 1.31.1. I added a obvious mistake for the linker (and surely there is more to lint):

if (nr_children == 0) == true {...

I installed Clippy via rustup: rustup component add clippy (and clippy-preview as well).

When I run cargo clippy, I get no output, only Finished dev [unoptimized + debuginfo] target(s) in 0.00s .

When I clean the build with cargo clean before calling Clippy, I get the lint warnings, but when I then re-run cargo clippy, nothing happens. Even if I modify the code and save it before running cargo clippy, no output. However, simply touch-ing the file, triggers Clippy to produce the linting.

What am I doing wrong here?

Peter Hall
  • 53,120
  • 14
  • 139
  • 204
Jounathaen
  • 803
  • 1
  • 9
  • 23
  • "What am I doing wrong here?", you probably didn't change the good file or didn't save it properly. – Stargateur Dec 21 '18 at 01:22
  • @Stargateur Well, it was my first guess too, but saving the file causes a recompile by `cargo run` or `cargo build` – Jounathaen Dec 21 '18 at 01:39
  • 2
    Btw: You don't need clippy-preview. Please remove that component, clippy is the new, stable component to add. – hellow Dec 21 '18 at 07:11

0 Answers0