rust-lang / rust-lang/rust-clippy

cargo lints: clippy dumps cargo metadata errors/warnigs into stderr

Open
#6,508 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

I noticed this by checking syn-1.0.54 downloaded from crates.io.

When I run cargo clippy -- --cap-lints warn -Wclippy::cargo, it looks like there is output leaking from cargo-metadata into the clippy warning such as the "warning: could not read ... Downloading crates.." stuff.

   Compiling proc-macro2 v1.0.24
    Checking unicode-xid v0.2.1
   Compiling syn v1.0.54 (/home/matthias/vcs/github/rust-clippy/target/crater/crates/syn-1.0.54)
warning: package `syn` is missing `package.keywords` metadata
  |
  = note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

    Checking quote v1.0.8
warning: could not read cargo metadata: Error during execution of `cargo metadata`:  Downloading crates ...
  Downloaded syn-test-suite v0.0.0
error: failed to verify the checksum of `syn-test-suite v0.0.0`

  |
  = note: `-W clippy::multiple-crate-versions` implied by `-W clippy::cargo`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

warning: 2 warnings emitted

warning: package `syn` is missing `package.keywords` metadata
  |
  = note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

warning: could not read cargo metadata: Error during execution of `cargo metadata`:  Downloading crates ...
  Downloaded syn-test-suite v0.0.0
error: failed to verify the checksum of `syn-test-suite v0.0.0`

  |
  = note: `-W clippy::multiple-crate-versions` implied by `-W clippy::cargo`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

warning: 2 warnings emitted

    Finished dev [unoptimized + debuginfo] target(s) in 6.24s

clippy @ 015496579dae282a7215a6ad17fe053342d8b825

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with cargo clippy -- --cap-lints warn -Wclippy::cargo against the reported syn-1.0.54 case, starting with the cargo metadata invocation and how its output reaches Clippy diagnostics. Done means metadata download and checksum messages no longer appear inside lint warnings while relevant metadata failures remain understandable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.