-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
A-uiArea: Clippy interface, usage and configurationArea: Clippy interface, usage and configurationC-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions
Description
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
Labels
A-uiArea: Clippy interface, usage and configurationArea: Clippy interface, usage and configurationC-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
jyn514 commentedon Oct 27, 2020
@rustbot modify labels: +A-suggestion
deref_addrof
andtry_err
lints #6278matthiaskrgr commentedon Jan 8, 2024
Still a problem: