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

cache-messages will cache incorrect messages when switching between cargo check and cargo clippy #7635

Closed
Nemo157 opened this issue Nov 27, 2019 · 1 comment
Labels
C-bug Category: bug

Comments

@Nemo157
Copy link
Member

Nemo157 commented Nov 27, 2019

> cargo new --lib foo
     Created library `foo` package
> cd foo
> echo 'fn foo(_: &u8) {}' > src/lib.rs

> cargo check
    Checking foo v0.1.0 (/tmp/tmp.aMWSnXGUN2/foo)
warning: function is never used: `foo`
 --> src/lib.rs:1:4
  |
1 | fn foo(_: &u8) {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

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

> cargo clippy
warning: function is never used: `foo`
 --> src/lib.rs:1:4
  |
1 | fn foo(_: &u8) {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

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

> cargo clean

> cargo clippy
    Checking foo v0.1.0 (/tmp/tmp.aMWSnXGUN2/foo)
warning: function is never used: `foo`
 --> src/lib.rs:1:4
  |
1 | fn foo(_: &u8) {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
 --> src/lib.rs:1:11
  |
1 | fn foo(_: &u8) {}
  |           ^^^ help: consider passing by value instead: `u8`
  |
  = note: `#[warn(clippy::trivially_copy_pass_by_ref)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

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

> cargo --version
cargo 1.41.0-nightly (8280633db 2019-11-11)
also the inverse applies, running `cargo check` now will return clippy's results
> cargo clippy
warning: function is never used: `foo`
 --> src/lib.rs:1:4
  |
1 | fn foo(_: &u8) {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
 --> src/lib.rs:1:11
  |
1 | fn foo(_: &u8) {}
  |           ^^^ help: consider passing by value instead: `u8`
  |
  = note: `#[warn(clippy::trivially_copy_pass_by_ref)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
> cargo check
warning: function is never used: `foo`
 --> src/lib.rs:1:4
  |
1 | fn foo(_: &u8) {}
  |    ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
 --> src/lib.rs:1:11
  |
1 | fn foo(_: &u8) {}
  |           ^^^ help: consider passing by value instead: `u8`
  |
  = note: `#[warn(clippy::trivially_copy_pass_by_ref)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
@Nemo157 Nemo157 added the C-bug Category: bug label Nov 27, 2019
@ehuss
Copy link
Contributor

ehuss commented Dec 3, 2019

Thanks for the report. We're trying to fix this in #7533, so I'm going to close since we're already working on it.

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

No branches or pull requests

2 participants