Weird errors when using Clippy

I'm trying to use Clippy, which I've been using for a while in my project. But recently whenever I run cargo clippy, I get this error:

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/Users/<redacted>/.rustup/toolchains/stable-x86_64-apple-darwin/bin/clippy-driver rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 1)
  --- stderr
  error: multiple input filenames provided (first two filenames are `-` and `clippy::suspicious`)

The error makes no sense to me, It seems clippy is not calling rustc properly? Am I invoking Clippy incorrectly? cargo clippy should be all right? Here is the output of rustc -Vv

rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-apple-darwin
release: 1.57.0
LLVM version: 13.0.0

Not claiming expertise on rustc/clippy here, but you’re using 1.57.0 of rustc, which is relatively new. When you upgraded rustc, was clippy upgraded with it? Could it be their versions have somehow become incompatible?

Running clippy with a simple ‘cargo clippy’ has always worked fine for me, so don’t think you’re missing anything there.

Yup, I update everything with rustup update and clippy does get updated with everything else

That looks like a bug in cargo or clippy. I suggest file a bug about this.

To collect more data, run with:

CARGO_LOG=debug cargo -vvv clippy
1 Like

Well Clippy just randomly decided to start working again. I literally did nothing except run rustup update which updated the nightly toolchain. I don't even use nightly

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.