use if_chain::if_chain;
use crate::utils::SpanlessEq;
-use crate::utils::{get_parent_expr, is_allowed, match_type, paths, span_lint, span_lint_and_sugg, walk_ptrs_ty};
+use crate::utils::{
+ get_parent_expr, in_macro, is_allowed, match_type, paths, span_lint, span_lint_and_sugg, walk_ptrs_ty,
+};
declare_clippy_lint! {
/// **What it does:** Checks for string appends of the form `x = x + y` (without
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for StringAdd {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
+ if in_macro(e.span) {
+ return;
+ }
+
if let ExprKind::Binary(
Spanned {
node: BinOpKind::Add, ..