Skip to content

Clippy reports warnings twice on suggestion errors #6235

Open
@jyn514

Description

@jyn514

I tried the code from #6234.
I expected to see one error, from the incorrect 'fixed' code, and one warning from the original code.

Instead, this happened: I saw one error and two warnings:

Original diagnostics will follow.

warning: immediately dereferencing a reference
 --> src/lib.rs:2:26
  |
2 |     ($visitor: expr) => (*&$visitor)
  |                          ^^^^^^^^^^ help: try this: `self`
...
8 |         m!(self)
  |         -------- in this macro invocation
  |
  = note: `#[warn(clippy::deref_addrof)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof
  = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: immediately dereferencing a reference
 --> src/lib.rs:2:26
  |
2 |     ($visitor: expr) => (*&$visitor)
  |                          ^^^^^^^^^^ help: try this: `self`
...
8 |         m!(self)
  |         -------- in this macro invocation
  |
  = note: `#[warn(clippy::deref_addrof)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof
  = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: 1 warning emitted

warning: 1 warning emitted

Meta

  • cargo clippy -V: clippy 0.0.212 (ffa2e7a 2020-10-24)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-uiArea: Clippy interface, usage and configurationC-bugCategory: Clippy is not doing the correct thingL-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