Skip to content

Clippy doesn't report error/warnings after cargo check #4612

Description

@b1zzu

Environment

Project: https://github.com/b1zzu/wifiscanner/tree/clippy-bug (use the clippy-bug branch`)
Cargo: cargo 1.38.0 (23ef9a4ef 2019-08-20)
Clippy: clippy 0.0.212 (3aea860 2019-09-03)

Steps to reproduce

Run cargo clippy after cargo check

cargo check
cargo clippy

Clippy doesn't fail or display any errors.

Expected result

cargo clippy should fails with this errors:

warning: Constants have by default a `'static` lifetime
  --> src/lib.rs:87:22
   |
87 |     const PATH_ENV: &'static str = "PATH";
   |                     -^^^^^^^---- help: consider removing `'static`: `&str`
   |
   = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes

error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
  --> src/lib.rs:85:14
   |
85 |     let _x = 3.14;
   |              ^^^^
   |
   = note: `#[deny(clippy::approx_constant)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant

warning: single-character string constant used as pattern
   --> src/lib.rs:157:16
    |
157 |         .split("\n")
    |                ^^^^ help: try using a char instead: `'\n'`
    |
    = note: `#[warn(clippy::single_char_pattern)]` on by default
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern

warning: single-character string constant used as pattern
   --> src/lib.rs:168:36
    |
168 |     for line in network_list.split("\n") {
    |                                    ^^^^ help: try using a char instead: `'\n'`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern

error: aborting due to previous error

error: Could not compile `wifiscanner`.

To learn more, run the command again with --verbose.

Workaround

cargo check
cargo clean
cargo clippy

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-cargoType: cargo related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions