Rust version: rustc 1.23.0-nightly (ee22861 2017-11-07)
Clippy version: 0.0.169
What happened
I have a project full repo here with this Cargo.toml:
[package]
name = "clippy-weirdness"
version = "0.1.0"
authors = ["Carol (Nichols || Goulding) <[email protected]>"]
[dependencies]
clippy = { version = "=0.0.169", optional = true }
[features]
cargo-clippy = ["clippy"]
and this src/lib.rs:
pub fn foo() {
let line = String::from("hello");
if !line.starts_with("y") {
return;
}
}
If I run CLIPPY=YESPLEASE cargo check --features "cargo-clippy", I don't get any warnings:
$ CLIPPY=YESPLEASE cargo check --features "cargo-clippy"
Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
However, if I run cargo clippy (and I have installed clippy using cargo install clippy --force --vers 0.0.169), I do get a warning:
$ cargo clippy
Compiling clippy-weirdness v0.1.0 (file:///Users/carolnichols/rust/clippy-weirdness)
warning: single-character string constant used as pattern
--> src/lib.rs:3:26
|
3 | if !line.starts_with("y") {
| -----------------^^^- help: try using a char instead: `line.starts_with('y')`
|
= note: #[warn(single_char_pattern)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.169/index.html#single_char_pattern
Finished dev [unoptimized + debuginfo] target(s) in 0.20 secs
What I expected
I expected cargo clippy and cargo check --features="cargo-clippy" to either both have the same warnings or both not to have any warnings :(
Even curiouser
The above behavior happens if i run cargo clean and then run cargo clippy FIRST. If I run cargo clean, then cargo check --features="cargo-clippy", and THEN cargo clippy, then cargo clippy also does not show any warnings!!
/cc @jtgeibel
Rust version: rustc 1.23.0-nightly (ee22861 2017-11-07)
Clippy version: 0.0.169
What happened
I have a project full repo here with this
Cargo.toml:and this src/lib.rs:
If I run
CLIPPY=YESPLEASE cargo check --features "cargo-clippy", I don't get any warnings:However, if I run
cargo clippy(and I have installed clippy usingcargo install clippy --force --vers 0.0.169), I do get a warning:What I expected
I expected
cargo clippyandcargo check --features="cargo-clippy"to either both have the same warnings or both not to have any warnings :(Even curiouser
The above behavior happens if i run
cargo cleanand then runcargo clippyFIRST. If I runcargo clean, thencargo check --features="cargo-clippy", and THENcargo clippy, thencargo clippyalso does not show any warnings!!/cc @jtgeibel