-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 check
no longer shows warnings unconditionally
#5455
Comments
I believe this is a consequence of rust-lang/rust#49289 which should unify the behavior of libraries and binaries |
Is this expected behavior then? (Which is fine---the workaround is easy enough.) |
Currently, yeah, I believe this is expected behavior |
My apologies, I forgot to include closed issues when I looked for existing issues about this, so I missed the prior discussions linked from #5236. You can close this one as a dupe if you want. |
Ok and no worries! I'll go ahead and close this |
In the past,
cargo check
would always show every warning that acargo clean && cargo build
would show, even if there were no errors and I'd already runcargo check
. For example, if I had an unused variable,cargo check
would print something like this every time I ran it, regardless of file timestamps or build artifacts:Recently the behavior changed, and now
cargo check
only shows warnings if I touch the source code or delete the build artifacts. Otherwise, it just acts the same ascargo build
does when the build is up to date:The first nightly release with the new behavior is
nightly-2018-04-15
. The change seems to have been caused by rustc, and a bisect of the rust-lang/rust repo showed commit 2a5f3ee0c5b5 as the culprit. I'm not familiar with the Rust build system, but I did notice that for a binary crate, deleting any of the following files will makecargo check
print warnings the next time I run it:target/debug/lib{name}.rmeta
target/debug/deps/lib{name}-{id}.rmeta
target/debug/.fingerprint/{name}-{id}/bin-{name}-{id}
target/debug/.fingerprint/{name}-{id}/dep-bin-{name}-{id}
I don't know if this is technically a bug report or a feature request. Let me know if I should file it against rust instead of Cargo.
versions
The last Rust release with the old behavior is
nightly-2018-04-12
, which has Cargo version1.26.0-nightly (b70ab13b3 2018-04-04)
.The first Rust release with the new behavior is
nightly-2018-04-15
, which has Cargo version1.26.0-nightly (008c36908 2018-04-13)
.I got both of those releases through rustup. The specific version of Cargo doesn't seem to matter, though, since (as I mentioned) it was a rustc change that caused the behavior change.
The text was updated successfully, but these errors were encountered: