Skip to content

New library crate created with cargo new fails clippy #9759

Closed

Description

@lopopolo

Problem

Newly created crates with cargo new fail clippy with default settings on stable.

New crates created from a template should not generate warnings.

Steps

$ cargo new --lib clippy-test
     Created library `clippy-test` package
$ cd clippy-test/
/Users/lopopolo/dev/artichoke/clippy-test
$ cargo clippy --all-features --all-targets
    Checking clippy-test v0.1.0 (/Users/lopopolo/dev/artichoke/clippy-test)
error: identical args used in this `assert_eq!` macro call
 --> src/lib.rs:5:20
  |
5 |         assert_eq!(2 + 2, 4);
  |                    ^^^^^^^^
  |
  = note: `#[deny(clippy::eq_op)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#eq_op

error: aborting due to previous error

error: could not compile `clippy-test`

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

Possible Solution(s)

Update the built in new crate template or suppress the clippy warning.

Notes

Output of cargo version:

cargo 1.54.0 (5ae8d74b3 2021-06-22)

Activity

  1. 0xPoe commented on Aug 17, 2021

    @0xPoe
    Member

    @rustbot claim

  2. added a commit that references this issue on Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions