1
Fork 0
This commit is contained in:
flip1995 2019-11-25 13:18:38 +01:00
parent cc35165f52
commit d43c424145
No known key found for this signature in database
GPG key ID: 693086869D506637
26 changed files with 48 additions and 48 deletions

View file

@ -37,7 +37,7 @@ impl EarlyLintPass for DerefAddrOf {
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) {
if_chain! {
if let ExprKind::Unary(UnOp::Deref, ref deref_target) = e.kind;
if let ExprKind::AddrOf(_, ref addrof_target) = without_parens(deref_target).kind;
if let ExprKind::AddrOf(_, _, ref addrof_target) = without_parens(deref_target).kind;
if !in_macro(addrof_target.span);
then {
let mut applicability = Applicability::MachineApplicable;
@ -80,7 +80,7 @@ impl EarlyLintPass for RefInDeref {
if_chain! {
if let ExprKind::Field(ref object, _) = e.kind;
if let ExprKind::Paren(ref parened) = object.kind;
if let ExprKind::AddrOf(_, ref inner) = parened.kind;
if let ExprKind::AddrOf(_, _, ref inner) = parened.kind;
then {
let mut applicability = Applicability::MachineApplicable;
span_lint_and_sugg(