Don't lint deref_addrof when the two operations occur in different expansions
This commit is contained in:
parent
88f5be2041
commit
d32277d78e
4 changed files with 7 additions and 2 deletions
|
|
@ -50,6 +50,7 @@ impl EarlyLintPass for DerefAddrOf {
|
|||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue