Skip to content

Commit 61230f4

Browse files
committed
Fixed incosistent_struct_constructor triggers in macro-generated code
1 parent faa9756 commit 61230f4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clippy_lints/src/inconsistent_struct_constructor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ declare_lint_pass!(InconsistentStructConstructor => [INCONSISTENT_STRUCT_CONSTRU
6666
impl LateLintPass<'_> for InconsistentStructConstructor {
6767
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
6868
if_chain! {
69+
if !expr.span.from_expansion();
6970
if let ExprKind::Struct(qpath, fields, base) = expr.kind;
7071
let ty = cx.typeck_results().expr_ty(expr);
7172
if let Some(adt_def) = ty.ty_adt_def();

0 commit comments

Comments
 (0)