Skip to content

Commit ac37507

Browse files
committed
Fix fallout in redundant_field_names
1 parent c720020 commit ac37507

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clippy_lints/src/redundant_field_names.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::utils::span_lint_and_sugg;
22
use rustc_ast::ast::{Expr, ExprKind};
33
use rustc_errors::Applicability;
44
use rustc_lint::{EarlyContext, EarlyLintPass};
5+
use rustc_middle::lint::in_external_macro;
56
use rustc_session::{declare_lint_pass, declare_tool_lint};
67

78
declare_clippy_lint! {
@@ -36,6 +37,9 @@ declare_lint_pass!(RedundantFieldNames => [REDUNDANT_FIELD_NAMES]);
3637

3738
impl EarlyLintPass for RedundantFieldNames {
3839
fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
40+
if in_external_macro(cx.sess, expr.span) {
41+
return;
42+
}
3943
if let ExprKind::Struct(_, ref fields, _) = expr.kind {
4044
for field in fields {
4145
if field.is_shorthand {

0 commit comments

Comments
 (0)