Skip to content

Add automatically applicable suggestion to should_assert_eq lint #1849

Closed
@killercup

Description

@killercup

Found by running rustfix on https://github.com/space-wizards/bsdiff-rs. Hopefully not that hard assuming the lint already has a way to parse the expression as x == y.

warning: use `assert_eq` for better reporting
  --> tests/test.rs:25:5
   |
25 |     assert!(&expected == cursor.get_ref());
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: #[warn(should_assert_eq)] on by default
   = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#should_assert_eq
   = note: this error originates in a macro outside of the current crate

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions