Skip to content

Commit 87ea0d7

Browse files
Suppress suggestions in derive macro
1 parent 8c0b4f6 commit 87ea0d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,6 +2698,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
26982698
return false;
26992699
}
27002700

2701+
if expr.span.in_derive_expansion() {
2702+
// Ignore if span is from derive macro.
2703+
return false;
2704+
}
2705+
27012706
let Ok(src) = self.tcx.sess.source_map().span_to_snippet(expr.span) else {
27022707
return false;
27032708
};

0 commit comments

Comments
 (0)