if_chain! {
if let ExprKind::Unary(UnOp::Deref, ref deref_target) = e.kind;
if let ExprKind::AddrOf(_, ref mutability, ref addrof_target) = without_parens(deref_target).kind;
+ if deref_target.span.ctxt() == e.span.ctxt();
if !addrof_target.span.from_expansion();
then {
let mut applicability = Applicability::MachineApplicable;
| ^^^^^^ help: try this: `aref`
error: immediately dereferencing a reference
- --> $DIR/deref_addrof.rs:45:9
+ --> $DIR/deref_addrof.rs:47:9
|
LL | *& $visitor
| ^^^^^^^^^^^ help: try this: `$visitor`
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: immediately dereferencing a reference
- --> $DIR/deref_addrof.rs:52:9
+ --> $DIR/deref_addrof.rs:54:9
|
LL | *& mut $visitor
| ^^^^^^^^^^^^^^^ help: try this: `$visitor`